Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 27
Registered: ‎05-10-2012
My Device: bold 9700
My Carrier: Vodafone

ON KeyDown Event certain action does not work??

I am using a KeyDown event to move a shape across the screen but it seems I have to press it release my finger from the key and press it again for things to work, I want to keep my hand on the key and it to continuosly do what I have instructed it to do?? 


 public boolean keyDown(int keycode, int time) {
		if (Keypad.key(keycode) == Keypad.KEY_SHIFT_LEFT)
			left = true;
			return true;
		} else if (Keypad.key(keycode) == Keypad.KEY_SHIFT_RIGHT)
			right = true;
			return true;
		if (Keypad.key(keycode)== Keypad.KEY_SPACE)
			space = true;
		return false;


Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: ON KeyDown Event certain action does not work??

Try overriding keyRepeat method.


Here is a link to the docs: