3

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 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.

4

3 回答 3

1

一个屏幕需要有焦点才能获得关键事件。

出于安全原因,RIM 不允许对其硬件进行低级别访问。

按住字母键并滚动拇指轮可滚动浏览国际/重音字符、等式符号和其他标记。

这里是源

于 2010-02-16T01:21:46.680 回答
0

这是一个很晚的回复,但是......

您可以使用 keyChar(屏幕的成员和 KeyListenerInterface 的成员)来拦截任何键 - 对于第一个字母,捕获按下的键。如果它是“$”,请保留它并且不要调用 super.keyChar。如果之前按下了 $,则在下一个 keyChar(或在没有输入的延迟之后)执行映射,并将您设计的字符代码发送到 super.keyChar 调用。如果 keyChar 存在实现问题,可以类似地使用 keyDown 和 keyUp。

于 2010-10-21T20:27:03.170 回答
0

黑莓不允许执行应用程序,如果他们使用某些 API,更不用说低级编程了。

你可以在你的应用程序中使用所有的键盘处理 - 它是 Java 的可能性。像 KeyListener 接口和 Keypad 类。

于 2010-02-15T23:40:07.027 回答