net.rim.device.api.system
Class EventInjector.KeyEvent
java.lang.Object
net.rim.device.api.system.EventInjector.Event
net.rim.device.api.system.EventInjector.KeyEvent
- Enclosing class:
- EventInjector
public static class EventInjector.KeyEvent
- extends EventInjector.Event
The event class that defines a character input event.
Historically, this event class defined a KeyPad event. In reality, KeyEvent represents the input of a
character and not the actual event of a key being pressed. You should use this event class if you wish to
input text into a TextField or other such areas where characters themselves are required as input.
To inject physical key events, use EventInjector.KeyCodeEvent.
- See Also:
EventInjector,
EventInjector.Event,
EventInjector.TrackwheelEvent,
EventInjector.KeyCodeEvent,
EventInjector.NavigationEvent- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
|
Field Summary |
|
static int |
KEY_DOWN
Represents a constant indicating that the key is in the down position. |
|
static int |
KEY_REPEAT
Represents a constant indicating that the key is in the down
position, repeating the character. |
|
static int |
KEY_UP
Represents a constant indicating that the key is in the up position. |
|
Constructor Summary |
|
EventInjector.KeyEvent(int event,
char c,
int status)
Constructs a new KeyEvent instance whose time is set to the current device uptime. |
|
EventInjector.KeyEvent(int event,
char c,
int status,
int time)
Deprecated. Use KeyEvent(int, char, int) instead. |
KEY_DOWN
public static final int KEY_DOWN
- Represents a constant indicating that the key is in the down position.
- See Also:
- Constant Field Values
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
KEY_REPEAT
public static final int KEY_REPEAT
- Represents a constant indicating that the key is in the down
position, repeating the character.
- See Also:
- Constant Field Values
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
KEY_UP
public static final int KEY_UP
- Represents a constant indicating that the key is in the up position.
- See Also:
- Constant Field Values
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
EventInjector.KeyEvent
public EventInjector.KeyEvent(int event,
char c,
int status)
- Constructs a new KeyEvent instance whose time is set to the current device uptime.
- Parameters:
event - One of KEY_DOWN, KEY_REPEAT or KEY_UP.c - The character to invoke. Special characters are defined by Characters.status - Any status flags (as defined by KeypadListener).- See Also:
Characters- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.5.0
EventInjector.KeyEvent
public EventInjector.KeyEvent(int event,
char c,
int status,
int time)
- Deprecated. Use KeyEvent(int, char, int) instead.
- Constructs a new KeyEvent instance whose time is set to the current device uptime.
- Parameters:
event - One of KEY_DOWN, KEY_REPEAT or KEY_UP.c - The character to invoke. Special characters are defined by Characters.status - Any status flags (as defined by KeypadListener).time - No longer used. Time is set to the current device uptime.- See Also:
Characters- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
setChar
public void setChar(char c)
- Sets the character of the event.
- Parameters:
c - The character to set.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
getChar
public char getChar()
- Returns the character of the event.
- Returns:
- The character.
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
setTime
public void setTime(int time)
- Deprecated. Use
EventInjector.Event.setTimeToCurrent() instead.
- Sets the time of this event to the current device uptime.
- Parameters:
time - No longer used. Time is set to the current device uptime.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
getTime
public int getTime()
- Description copied from class:
EventInjector.Event
- Returns the time of the event.
- Overrides:
getTime in class EventInjector.Event
- Returns:
- An integer representing the time of the event.
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal