diff options
author | Alexis211 <alexis211@gmail.com> | 2009-09-11 16:22:30 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-09-11 16:22:30 +0200 |
commit | 7b0d6ac9f903296c7537cec9ac606d49cb364049 (patch) | |
tree | c9bc6aaf4e7237cf5577f3a78291f1f591fe1563 /Source/Kernel/DeviceManager/Kbd.ns.cpp | |
parent | d95452c5452b4ca7418505fa5597f000596fcb78 (diff) | |
download | Melon-7b0d6ac9f903296c7537cec9ac606d49cb364049.tar.gz Melon-7b0d6ac9f903296c7537cec9ac606d49cb364049.zip |
Nothing, really
Diffstat (limited to 'Source/Kernel/DeviceManager/Kbd.ns.cpp')
-rw-r--r-- | Source/Kernel/DeviceManager/Kbd.ns.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Source/Kernel/DeviceManager/Kbd.ns.cpp b/Source/Kernel/DeviceManager/Kbd.ns.cpp index 135d521..95a97e3 100644 --- a/Source/Kernel/DeviceManager/Kbd.ns.cpp +++ b/Source/Kernel/DeviceManager/Kbd.ns.cpp @@ -26,7 +26,7 @@ u8int ctrlkeys[] = { /* 0xF0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -wchar *keymapNormal = NULL, *keymapShift = NULL, *keymapAltgr = NULL, *keymapShiftAltgr = NULL; +WChar *keymapNormal = NULL, *keymapShift = NULL, *keymapCaps = NULL, *keymapAltgr = NULL, *keymapShiftAltgr = NULL; u8int kbdstatus = 0; VirtualTerminal *focusedVT = NULL; //This is the VT that must receive the character @@ -58,9 +58,10 @@ void setFocus(VirtualTerminal* vt) { focusedVT = vt; } -void setKeymap(wchar* kmNormal, wchar* kmShift, wchar* kmAltgr, wchar* kmShiftAltgr) { +void setKeymap(WChar* kmNormal, WChar* kmShift, WChar* kmCaps, WChar* kmAltgr, WChar* kmShiftAltgr) { keymapNormal = kmNormal; keymapShift = kmShift; + keymapCaps = kmCaps; keymapAltgr = kmAltgr; keymapShiftAltgr = kmShiftAltgr; } @@ -85,11 +86,14 @@ void keyPress(u8int scancode) { if ((kbdstatus & STATUS_ALT) or (kbdstatus & STATUS_CTRL)) { kp.hascmd = true; } - if ((kbdstatus & STATUS_SHIFT) xor (kbdstatus & STATUS_CAPS)) { + if (((kbdstatus & STATUS_SHIFT) != 0) xor ((kbdstatus & STATUS_CAPS) != 0)) { if (kbdstatus & STATUS_ALTGR) { if (keymapShiftAltgr != NULL) kp.character = keymapShiftAltgr[scancode]; } else { - if (keymapShift != NULL) kp.character = keymapShift[scancode]; + if (keymapCaps != NULL and (kbdstatus & STATUS_CAPS)) + kp.character = keymapCaps[scancode]; + else if (keymapShift != NULL) + kp.character = keymapShift[scancode]; } } else { if (kbdstatus & STATUS_ALTGR) { @@ -152,11 +156,14 @@ void keyRelease(u8int scancode) { if ((kbdstatus & STATUS_ALT) or (kbdstatus & STATUS_CTRL)) { kp.hascmd = true; } - if ((kbdstatus & STATUS_SHIFT) xor (kbdstatus & STATUS_CAPS)) { + if (((kbdstatus & STATUS_SHIFT) != 0) xor ((kbdstatus & STATUS_CAPS) != 0)) { if (kbdstatus & STATUS_ALTGR) { if (keymapShiftAltgr != NULL) kp.character = keymapShiftAltgr[scancode]; } else { - if (keymapShift != NULL) kp.character = keymapShift[scancode]; + if (keymapCaps != NULL and (kbdstatus & STATUS_CAPS)) + kp.character = keymapCaps[scancode]; + else if (keymapShift != NULL) + kp.character = keymapShift[scancode]; } } else { if (kbdstatus & STATUS_ALTGR) { |