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

Event injection

by Retired on ‎02-16-2010 09:27 AM - edited on ‎03-18-2011 01:36 PM by Retired (3,547 Views)



This article applies to the following:

    BlackBerry® smartphones based on Java® technology BlackBerry smartphone Simulator



Event injection is used to programmatically create and invoke specific events into the system while using the BlackBerrySmartphone Simulator. The net.rim.device.api.system.EventInjector class is broken into several Event classes that can be injected. These are described in the following table:

Event class  Description 
EventInjector.Event The base class for events.
EventInjector.KeyCodeEvent The event class that defines a physical key press event. Use this class to create events that mimic an actual key being pressed on the device. This class may come in handy when the actual key pressed (and not the character that may result from the key being pressed) is important (i.e. injecting keyboard shortcuts, etc.).
EventInjector.KeyEvent 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.
EventInjector.NavigationEvent The event class that defines a Navigation event.
EventInjector.TrackwheelEvent The event class that defines a Trackwheel event.
EventInjector.TouchEvent The event class that defines a Touch event.

Event injection is restricted in the following situations:

  • Incoming Call
  • Device Locked
  • Firewall Prompt
  • Application Control Prompt
  • Calculator
Users Online
Currently online: 29 members 1,071 guests
Please welcome our newest community members: