开发者

How to create a BlackBerry App that access low level hardware?

开发者 https://www.devze.com 2022-12-20 11:27 出处:网络
I\'ve written some BlackBerry apps, but now i\'m trying to write one that must access the hardware (keyboard) in some low level way, and I can\'t seem to find a way to do it, nor any help to it in the

I've written some BlackBerry apps, but now i'm trying to write one that must access the hardware (keyboard) in some low level way, and I can't seem to find a way to do it, nor any help to it in the 'official' boards.

The thing is, I need to know when, at any time, the '$' key is pressed in the blackberry keyboard, so my app (or resident service) can catch it, stop the '$' char from displaying, and if the user presses a vowel next, then add an accent to that vowel... and if it presses another key, just send back the '$' char + the other char.

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

In other words, I need to create an app or service that converts the '$' key into an accent key, just like typical non-US PC keyboards works.

Now here's the problem: The whole Blackberry OS works under a Java Virtual Machine (Kind of making the JVM the actual OS). So as you开发者_Go百科 can imagine, every app written for it is written in Java.

There's obviously a set of special blackberry api libraries into their Java implementation so the developer is able to access particular Blackberry functions and features... however there doesn't seem to be a thing that I can use to achieve my particular task.

But then maybe there is, and I haven't found it, since I'm still new to Blackberry Programming.

So, in that note, any help or comment will be greatly appreciated.

-Gabriel Alonso.


A screen need to have the focus to be able to get key Event.

RIM dosen't allow low level access to their hardware for security reason.

Press and hold a letter key and roll the thumb-wheel to scroll through international/accent characters, equation symbols and other marks.

Here is the source


Blackberry do not allow execute applications, if they use certain API, not to mention the low-level programming.

All that you can use in your applications for keypad handling - it is possibilities of Java. Like KeyListener interface and Keypad class.


This is a very late reply, however...

You can use keyChar (member of screen, and of KeyListenerInterface) to intercept any key - for the first letter, capture the key pressed. If it's "$" hold onto it and don't call super.keyChar. On the next keyChar (or after a delay with no input) perform your mapping if $ was previously pressed, and send your designed character code to the super.keyChar call. keyDown and keyUp can be used similarly if keyChar presents implementation issues.

0

精彩评论

暂无评论...
验证码 换一张
取 消