Detecting external keyboard Key Down Events in IOS without EditText Field - bluetooth

I'm trying to detect key pressed for an external keyboard (via bluetooth) with an 4th generation iPad. I was only able to do so when the focus is on a EditText Field.
Without the edit text field, the key down events aren't captured by the program. Is there any work around for this issue?
I've tried to following, but this doesn't seem to work:
-(NSArray *) keyCommands
{
}

Related

X11 and fake keyboard / mouse events

I want to know as to how do you detect if a key press event or a mouse pointer event has been generated by an (automation like) application like xdotool. Basically, I am writing an application to check if there is no real mouse or keyboard activity. In my application I want to flag idle activity only if we don't have real mouse movement or real key press/release on the keyboard. Any reference regarding this would be great. I want to do this using pure xlib API. Don't want to use XCB. Any extensions such XRecord(which I am currently using to capture events) are fine.
Thanks in advance.
Yes there is a possibility.
All X11-events which are relevant for mouse movements and clicks have a member called "send_event".
It is set to "True" if the event was sent by an application. It is "False" if it was generated by the X-Server, i.e. by a user action.
If xdotool uses SendEvent for mousclick simulation than you'll be able to detect that using the "send_event" member.

Handle soft keys action in LWUIT

I'm developing an application for Nokia C2 Mobile and I want to handle the soft keys of the keyboard
Attached an image with the button that I want to handle
I have tried Handle KeyPressed and the keycode that returned when I press this button is 0
please what should I do ?
The button pointed is Right Soft Key (RSK). In that picture, they added commands GoTo, Menu and Names. Just like that, add commands to the form. Type the code to handle that event in command listener.

A keyboard with a UITextField

I have a table listing some strings, and what I want is when I tap the add button on the navigation bar, a keyboard with a textField would jump up, so I can input a string in the textField, then when I tap the return key, the keyboard disappear as well as the textField, and the new string is added to the table.
I already make up a nib file with a toolBar containing a textField, and I just failed to go on.
How can I implement this idea? Use the inputAccessoryView? If so, that means the inputAccessoryView of the textField which belongs to the toolBar is gonna be the toolBar itself!
This seem kind of weird and I have not been able to make it work till now.
Or is there another way for this idea?
Thanks a lot!
I've solved the problems by using notification instead of inputAccessoryView.
There is a sample code in XCode called "KeyboardAccessory", and it gives a good example about using keyboard notifications!
Or custom a view with a tab, and set it as the textField's inputAccessoryView, that would also work!

inputAccessoryView not hide the view when -resignFirstResponder?

I have attached a toolbar with a UITextField and UIButton to the keyboard when it becomes the first responder via the user taping inside the textfield
textField.inputAccessoryView = theToolbar;
Problem is, the toolbar disappears when the keyboard is dismissed, thus preventing any further input.
Any ideas on how to make the toolbar go back to the bottom of the screen rather than off it completely?
I'm thinking a delegate method might help but Im really not too sure. It seems once the inputAccessoryView always the inputAccessoryView :(
Cheers
The input accessory view is automatically dismissed with the input view (the keyboard, in this case). Generally you do not want to have an input accessory view in your view hierarchy. Instead, if you want your toolbar to scroll up when the keyboard is shown, you should follow the guidelines for Managing the Keyboard.
You could try using an additional toolbar that is offscreen as the inputAccessoryView, which could "fake" the appearance of what you are trying to do. Alternatively, have you tried adding the toolbar back to the bottom of the screen using
[self.view addSubview:theToolbar];
when the keyboard reaches the bottom of the screen? You can use keyboard notifications for this.

how to change the input mode of the mobile using j2me (MIDP2.0)?

I am working in j2me midp2.0 environment. Now, I want to draw String (custom item) based on user key pressed event. Here, my problem is, some phones default input mode is numeric and I can't be able to draw Strings. How to change this input mode to Strings and vice versa?
I think you manually get the key values and change it. On key press event you find which key pressed based on that you write a login to get numeric values or character, etc.

Resources