File tree 2 files changed +6
-9
lines changed
2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,6 @@ int numLockTable[256];
98
98
99
99
/* Send a key chord over the USB. */
100
100
void sendChar (byte key) {
101
- // TEMPORARY
102
101
if (key == VG_F6 + VG_CTRL + VG_SHIFT) { // 246
103
102
// Toggles the keyboard-iness
104
103
setUseSerialLibrary (!useSerialLibrary);
@@ -108,6 +107,9 @@ void sendChar(byte key) {
108
107
if (numLock) {
109
108
translated = numLockTable[key];
110
109
}
110
+ if (useSerialLibrary) {
111
+ Serial.print (" Before: " ); Serial.print (key); Serial.print (" after: " ); Serial.println (translated);
112
+ }
111
113
112
114
// Figure out what to do with the key
113
115
// * If "next is alt", send this char as alt
@@ -170,7 +172,7 @@ void sendChar(byte key) {
170
172
}
171
173
172
174
void pressKey (int translated, byte key) {
173
- byte rawCode = (translated & 0xff );
175
+ byte rawCode = (byte) ( translated & 0xff );
174
176
if (useSerialLibrary) {
175
177
if ((translated & CTRL_MOD) == CTRL_MOD) {
176
178
Serial.print (" ctrl+" );
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ void setupTable() {
51
51
setupKeyWModifiers (VG_RIGHT, KEY_RIGHT_ARROW);
52
52
53
53
translationTable[VG_NP_ENTER] = KEY_RETURN;
54
- translationTable[VG_NP_ENTER + VG_SHIFT] = KEY_RETURN;
54
+ translationTable[VG_NP_ENTER + VG_SHIFT] = SHIFT_MOD + KEY_RETURN;
55
55
56
56
// Numlock off: cursor keys:
57
57
translationTable[VG_NP_0] = KEY_INSERT;
@@ -96,11 +96,6 @@ void setupTable() {
96
96
}
97
97
98
98
// Numlock overrides:
99
-
100
- // Not sure why I needed these...
101
- numLockTable[VG_NP_ENTER] = KEY_RETURN;
102
- numLockTable[VG_NP_ENTER + VG_SHIFT] = KEY_RETURN;
103
-
104
99
numLockTable[VG_NP_0] = ' 0' ;
105
100
numLockTable[VG_NP_1] = ' 1' ;
106
101
numLockTable[VG_NP_2] = ' 2' ;
@@ -113,7 +108,7 @@ void setupTable() {
113
108
numLockTable[VG_NP_9] = ' 9' ;
114
109
numLockTable[VG_NP_DOT] = ' .' ;
115
110
116
- numLockTable[VG_NP_0 + VG_CTRL] = CTRL_MOD + ' 0 ' ;
111
+ // For future me: np0 + ctrl returns the same code as np0
117
112
numLockTable[VG_NP_1 + VG_CTRL] = CTRL_MOD + ' 1' ;
118
113
numLockTable[VG_NP_2 + VG_CTRL] = CTRL_MOD + ' 2' ;
119
114
numLockTable[VG_NP_3 + VG_CTRL] = CTRL_MOD + ' 3' ;
You can’t perform that action at this time.
0 commit comments