English 中文(简体)
检测Shift键是否按住
原标题:Detecting when the shift key is held down
  • 时间:2010-02-23 21:35:17
  •  标签:
  • blackberry

我正在尝试检测用户是否按住了Shift键(任一侧)(而无需按下任何其他键),但我无法弄清楚该如何做到这一点。这是我找到的唯一用于检测按下Shift键的方法:

   protected boolean keyStatus(int keycode, int time)
   {
    System.out.println("down");
    boolean retVal = false;
    int key = Keypad.key(keycode);
    if( key == Keypad.KEY_SHIFT_LEFT )
    {
            // do something
        retVal = true;
    }
    else if( key == Keypad.KEY_SHIFT_RIGHT )
    {
            // do something
        retVal = true;
    }
    return retVal;
   }

偷窃的拖网触发了本来是理想的关键草原和钥匙。 我失踪了什么?

问题回答

按住Shift键是否会触发多次按键? 如果是,您可以编写一个函数来检测特定数量的按键在给定的时间内。





相关问题
How does AlertListener work on Blackberry API 5.0?

Does the AlertListener interface works globally on all alerts on the blackberry device, or does it only work with alerts generated by your application? In other words, can I use this interface to ...

How to buffer audio in Blackberry?

I need to learn how to buffer audio stream from a remote server in Blackberry. There is a sample buffered playback app with Blackberry api but can you tell what url may I use to test the application?

Blackberry push notification implementation

How does one implement a push notification for a blackberry app? I heard that in order to do so I need to purchase a Blackberry Enterprise Server which costs me 1400 per year. Is this true? Where is ...

热门标签