summaryrefslogtreecommitdiff
path: root/Source/Kernel/DeviceManager
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-09-11 16:22:30 +0200
committerAlexis211 <alexis211@gmail.com>2009-09-11 16:22:30 +0200
commit7b0d6ac9f903296c7537cec9ac606d49cb364049 (patch)
treec9bc6aaf4e7237cf5577f3a78291f1f591fe1563 /Source/Kernel/DeviceManager
parentd95452c5452b4ca7418505fa5597f000596fcb78 (diff)
downloadMelon-7b0d6ac9f903296c7537cec9ac606d49cb364049.tar.gz
Melon-7b0d6ac9f903296c7537cec9ac606d49cb364049.zip
Nothing, really
Diffstat (limited to 'Source/Kernel/DeviceManager')
-rw-r--r--Source/Kernel/DeviceManager/Disp.ns.cpp2
-rw-r--r--Source/Kernel/DeviceManager/Disp.ns.h4
-rw-r--r--Source/Kernel/DeviceManager/Kbd.ns.cpp19
-rw-r--r--Source/Kernel/DeviceManager/Kbd.ns.h6
4 files changed, 19 insertions, 12 deletions
diff --git a/Source/Kernel/DeviceManager/Disp.ns.cpp b/Source/Kernel/DeviceManager/Disp.ns.cpp
index a59b27c..4be8d03 100644
--- a/Source/Kernel/DeviceManager/Disp.ns.cpp
+++ b/Source/Kernel/DeviceManager/Disp.ns.cpp
@@ -12,7 +12,7 @@ u16int textRows() {
return mode.textRows;
}
-void putChar(u16int line, u16int col, wchar c, u8int color) {
+void putChar(u16int line, u16int col, WChar c, u8int color) {
if (line >= mode.textRows or col >= mode.textCols) return;
mode.device->putChar(line, col, c, color);
}
diff --git a/Source/Kernel/DeviceManager/Disp.ns.h b/Source/Kernel/DeviceManager/Disp.ns.h
index e6c378b..5a92e69 100644
--- a/Source/Kernel/DeviceManager/Disp.ns.h
+++ b/Source/Kernel/DeviceManager/Disp.ns.h
@@ -2,7 +2,7 @@
#define DEF_DISP_NS_H
#include <Devices/Display/Display.proto.h>
-#include <Library/wchar.class.h>
+#include <Library/WChar.class.h>
namespace Disp {
struct mode_t {
@@ -12,7 +12,7 @@ namespace Disp {
u16int textCols();
u16int textRows();
- void putChar(u16int line, u16int col, wchar c, u8int color);
+ void putChar(u16int line, u16int col, WChar c, u8int color);
void moveCursor(u16int line, u16int col);
void clear();
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) {
diff --git a/Source/Kernel/DeviceManager/Kbd.ns.h b/Source/Kernel/DeviceManager/Kbd.ns.h
index efd7a48..34ad0e4 100644
--- a/Source/Kernel/DeviceManager/Kbd.ns.h
+++ b/Source/Kernel/DeviceManager/Kbd.ns.h
@@ -2,7 +2,7 @@
#define DEF_KBD_NS_H
#include <Core/common.wtf.h>
-#include <Library/wchar.class.h>
+#include <Library/WChar.class.h>
//Used by variable kbdstatus
#define STATUS_SCRL 0x40
@@ -87,12 +87,12 @@ namespace Kbd {
bool haschar;
u8int modifiers;
u8int command;
- wchar character; //is 0 if !haschar
+ WChar character; //is 0 if !haschar
keypress_t() : hascmd(false), haschar(false), command(0), character('\0') {};
};
void setFocus(VirtualTerminal* vt);
- void setKeymap(wchar* kmNormal, wchar* kmShift, wchar* kmAltgr, wchar* kmShiftAltgr = NULL);
+ void setKeymap(WChar* kmNormal, WChar* kmShift, WChar* kmCaps, WChar* kmAltgr, WChar* kmShiftAltgr = NULL);
void updateLeds();
void keyPress(u8int scancode);
void keyRelease(u8int scancode);