From f78e17fccc14c301158b6eabdc4bb96d85e55276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 16 Sep 2004 16:41:22 +0000 Subject: [PATCH] Added a brazilian keyboard mapping ABNT2 Keypad . to 0x70 Added handling for CtrlAltDel key combination, atm it only ensures we don't reboot ... Added handling for Menu key => send BeMn to Deskbar asking to show menu, could be moved somewhere else in the future (filter?) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8982 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../devices/keyboard/KeyboardInputDevice.cpp | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp b/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp index 7b360647c1..63fbf8eb7e 100644 --- a/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp +++ b/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp @@ -1,5 +1,5 @@ /*****************************************************************************/ -// Mouse input server device addon +// Keyboard input server device addon // Written by Jérôme Duval // // KeyboardInputDevice.cpp @@ -51,6 +51,7 @@ const static uint32 kSetRepeatingKey = 0x2712; const static uint32 kSetNonRepeatingKey = 0x2713; const static uint32 kSetKeyRepeatRate = 0x2714; const static uint32 kSetKeyRepeatDelay = 0x2716; +const static uint32 kCancelTimer = 0x2719; const static uint32 kGetNextKey = 0x270f; const static uint32 kKeyboardThreadPriority = B_FIRST_REAL_TIME_PRIORITY + 4; @@ -185,7 +186,7 @@ const uint32 at_keycode_map[] = { 0x6c, // Muhenkan, key left to spacebar, japanese 0x00, // UNMAPPED 0x6a, // Yen (macron key, japanese) - 0x00, // UNMAPPED + 0x70, // Keypad . on Brazilian ABNT2 0x00, // UNMAPPED 0x00, // UNMAPPED 0x00, // UNMAPPED @@ -608,10 +609,31 @@ KeyboardInputDevice::DeviceWatcher(void *arg) LOG("kGetNextKey : %Ld, %02x, %02x, %02lx, %02x\n", at_kbd->timestamp, at_kbd->scancode, at_kbd->is_keydown, keycode, at_kbd->scancode & 0x80); if (at_kbd->is_keydown) - states[(keycode)>>3] |= (1 << (7 - ((keycode) & 0x7))); + states[(keycode)>>3] |= (1 << (7 - (keycode & 0x7))); else - states[(keycode)>>3] &= (!(1 << (7 - ((keycode) & 0x7)))); - + states[(keycode)>>3] &= (!(1 << (7 - (keycode & 0x7)))); + + if (at_kbd->is_keydown + && (keycode == 0x34) // DELETE KEY + && (states[0x5c >> 3] & (1 << (7 - (0x5c & 0x7)))) + && (states[0x5d >> 3] & (1 << (7 - (0x5d & 0x7))))) { + + // show the team monitor + // argh we don't have one ! + + // cancel timer : TODO this should be done by the team monitor + if (ioctl(dev->fd, kCancelTimer, NULL)!=B_OK) + LOG_ERR("kCancelTimer : NOT OK\n"); + else + LOG("kCancelTimer : OK\n"); + } + + if (at_kbd->is_keydown + && (keycode == 0x68)) { // MENU KEY + + BMessenger("application/x-vnd.Be-TSKB").SendMessage('BeMn'); + } + uint32 modifiers = keymap->Modifier(keycode); if (modifiers && ( !(modifiers & (B_CAPS_LOCK | B_NUM_LOCK | B_SCROLL_LOCK))