Fix menu key handling so that message is sent only when pressed alone
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8987 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -628,6 +628,22 @@ KeyboardInputDevice::DeviceWatcher(void *arg)
|
|||||||
|
|
||||||
LOG(" %Ld, %02x, %02lx\n", timestamp, is_keydown, keycode);
|
LOG(" %Ld, %02x, %02lx\n", timestamp, is_keydown, keycode);
|
||||||
|
|
||||||
|
if (is_keydown
|
||||||
|
&& (keycode == 0x68) ) { // MENU KEY for OpenTracker 5.2.0+
|
||||||
|
bool nokey = true;
|
||||||
|
for (int32 i=0; i<16; i++)
|
||||||
|
if (states[i] != 0) {
|
||||||
|
nokey = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nokey) {
|
||||||
|
BMessenger msger("application/x-vnd.Be-TSKB");
|
||||||
|
if (msger.IsValid())
|
||||||
|
msger.SendMessage('BeMn');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (is_keydown)
|
if (is_keydown)
|
||||||
states[(keycode)>>3] |= (1 << (7 - (keycode & 0x7)));
|
states[(keycode)>>3] |= (1 << (7 - (keycode & 0x7)));
|
||||||
else
|
else
|
||||||
@@ -646,12 +662,6 @@ KeyboardInputDevice::DeviceWatcher(void *arg)
|
|||||||
LOG("kCancelTimer : OK\n");
|
LOG("kCancelTimer : OK\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_keydown
|
|
||||||
&& (keycode == 0x68)) { // MENU KEY for OpenTracker 5.2.0+
|
|
||||||
|
|
||||||
BMessenger("application/x-vnd.Be-TSKB").SendMessage('BeMn');
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 modifiers = keymap->Modifier(keycode);
|
uint32 modifiers = keymap->Modifier(keycode);
|
||||||
if (modifiers
|
if (modifiers
|
||||||
&& ( !(modifiers & (B_CAPS_LOCK | B_NUM_LOCK | B_SCROLL_LOCK))
|
&& ( !(modifiers & (B_CAPS_LOCK | B_NUM_LOCK | B_SCROLL_LOCK))
|
||||||
|
|||||||
Reference in New Issue
Block a user