在 BlackBerry 上使用 MIDP Canvas keyPressed / keyCode 获取 Canvas.FIRE 以进行轨迹球点击

发布于 2024-08-10 14:40:09 字数 342 浏览 1 评论 0原文

我有一个 MIDP 应用程序,想在 BlackBerry 设备上运行。它非常通用,一个问题是当我重写 Canvas keyPressed(int keyCode) 方法时,我没有捕获触控板单击事件。

通常您会使用 getGameAction(keyCode) == FIRE 来捕获 MIDP 设备上导航板按钮的中心,但在这种情况下没有运气。我对黑莓论坛进行了广泛的搜索,但找不到任何明确的解决方案。单击轨迹球按钮时是否会调用 keyPressed 方法?适当的密钥代码是什么?

我知道,如果我转向 BlackBerry SDK,我可以使用关键侦听器和触控板单击类型事件,但我想首先尝试找到一个纯 MIDP 并且不需要多个构建的解决方案。

I have a MIDP application that I would like to run on BlackBerry devices. It's quite generic, the one gotcha is that when I override the Canvas keyPressed(int keyCode) method, I'm not capturing the trackpad click events.

Normally you would use getGameAction(keyCode) == FIRE to capture the center of the navigation pad button on MIDP devices, but in this case no luck. I've done extensive searching of blackberry forums and I can't find any clear solution. Is they keyPressed method even called when the trackball button is clicked? What is the appropriate keyCode?

I know that if I move over the BlackBerry SDK I can use key listeners and trackpad clicked type events, but I would like to first attempt to find a solution that is pure MIDP and does not require multiple builds.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

电影里的梦 2024-08-17 14:40:09

According to the RIM javadoc for the Canvas class the trackball keycode is -8. That's a JDE 4.5 link, but it's the same in 4.3, 4.6 and 4.7. So you could put in some conditional behaviour for BlackBerry handsets that would look for that code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文