2

Is it possible to change what each key does? I have a client application and the way it needs to work is that each key press is a command to send over the network. I do not need my keyboard to produce letters (the server will do this) when pressed but commands to the server. Currently I have this working by making a custom view that looks like a keyboard however it would look better if it was the ios default keyboard.

Of course I dont expect the code but I need a starting point. My current google searching hasnt gone to good. Maybe a link to an example or some documentation on how to do it.

notes: you will see the first answer below makes a good suggestion but it brings up another point. my keyboard needs to mask the keyboard of the server, so no .com button or any other out of the ordinary keys, so I would also need to edit the layout I guess.

1 Answer 1

3

Create a text field with a custom delegate, hide it and set it as the first responder. Then you can hook into the delegate methods to work out what was pressed.

4
  • o ya, good idea! the only thing is that the original keyboard has alot more keys then myn.
    – owen gerig
    Commented Jan 4, 2012 at 14:33
  • You don't need to edit the layout. Just do nothing if you receive invalid letters, and make sure the text field is of the generic text type rather than a URL or email address.
    – jrtc27
    Commented Jan 5, 2012 at 10:47
  • i dont want to show keys that would do nothing, thats to sloppy. o well, ill mark it as answered and have to research editing the layout of the keyboard
    – owen gerig
    Commented Jan 5, 2012 at 14:29
  • Well, unfortunately, you cannot edit the keyboard layout, only choose from the different available ones based on the input type. If you really need to hide keys then sadly I think you will have to go back to making your own.
    – jrtc27
    Commented Jan 5, 2012 at 14:30

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.