1
0
mirror of https://bitbucket.org/C_Classic/prgkbd.git synced 2024-11-22 10:15:06 +01:00

Added push-and-hold for modifier keys

This commit is contained in:
Markus Koch 2013-08-16 20:35:03 +02:00
parent 6a254d677d
commit c77fe87379

View File

@ -296,7 +296,6 @@ void continueExecution() {
}
}
else { //press
if (!flag_keyPress) {
if (reportBuffer[x] == 0) { //we found an empty key
reportBuffer[x] = instr; //press it
@ -315,8 +314,18 @@ void continueExecution() {
}
newData = 1; //exit loop
}
else if (instr >= 224 && instr <= 231) reportBuffer[0] |= (1 << (instr - 224)); // MOD-Keys (en)
else if (instr >= 232 && instr <= 239) reportBuffer[0] &= ~(1 << (instr - 232)); // MOD-Keys (dis)
else if (instr >= 224 && instr <= 231) {
//reportBuffer[0] |= (1 << (instr - 224)); // MOD-Keys (en)
if ((keyType[oldKey-1] == KEYTYPE_TEXT) || keyAction == KEYACTION_DOWN) reportBuffer[0] |= (1 << (instr - 224)); // MOD-Keys (en)
else reportBuffer[0] &= ~(1 << (instr - 224)); // MOD-Keys (dis)
}
else if (instr >= 232 && instr <= 239) {
reportBuffer[0] &= ~(1 << (instr - 232)); // MOD-Keys (dis)
if ((keyType[oldKey-1] == KEYTYPE_TEXT) || keyAction == KEYACTION_DOWN) reportBuffer[0] &= ~(1 << (instr - 232)); // MOD-Keys (dis)
else reportBuffer[0] |= (1 << (instr - 232)); // MOD-Keys (en)
}
// MODS-KEYS are enabled/disabled using different commands. This will make it easier when being in text-mode.
/* OLD PART FOR MOD-KEYS: Replaced by new command set
New one is independent from mode