How to create a BlackBerry application for access to low-level equipment?

I have written several BlackBerry applications, but now I am trying to write one that should access the equipment (keyboard) at some low level, and I can’t find a way to do this, nor any help to him in the “official” tips.

The thing is, I need to know when the $$ key is pressed at any time on the Blackberry keyboard, so my application (or resident service) can catch it, stop the "$" char from displaying, and if the user presses the vowel further, add an accent to this vowel ... and if he presses another key, just send back the '$' char + another char.

i.e. '$' + 'a' = á

In other words, I need to create an application or service that converts the $ key to an accent key, just like a typical non-US keyboard works.

Now here's the problem: the entire Blackberry operating system runs under the Java virtual machine (which makes the JVM a real OS). So, as you can imagine, every application written for it is written in Java.

The Java implementation clearly includes a set of special api libraries for Blackberry, so the developer can access certain Blackberry features and functions ... however, it seems like I can't use this task to achieve my specific task.

But then maybe there is, and I did not find it, since I'm still new to Blackberry programming.

So, in this article we will be grateful for any help or comment.

-Gabriel Alonso.

+3
3

, .

RIM .

, / , .

+1

Blackberry , API, .

, - Java. KeyListener .

0

, ...

You can use keyChar (screen member and KeyListenerInterface) to intercept any key - for the first letter, capture the key pressed. If it is "$" held on it and does not call super.keyChar. On the next keyChar (or after a delay without input), perform a match if the $ value was previously pressed and send the code of the developed character to the call to super.keyChar. keyDown and keyUp can be used in the same way if keyChar presents implementation problems.

0
source

Source: https://habr.com/ru/post/1732924/


All Articles