mirror of
https://bitbucket.org/C_Classic/prgkbd.git
synced 2024-11-22 18:25:09 +01:00
Added push-and-hold for modifier keys
This commit is contained in:
parent
6a254d677d
commit
c77fe87379
@ -296,7 +296,6 @@ void continueExecution() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { //press
|
else { //press
|
||||||
|
|
||||||
if (!flag_keyPress) {
|
if (!flag_keyPress) {
|
||||||
if (reportBuffer[x] == 0) { //we found an empty key
|
if (reportBuffer[x] == 0) { //we found an empty key
|
||||||
reportBuffer[x] = instr; //press it
|
reportBuffer[x] = instr; //press it
|
||||||
@ -315,8 +314,18 @@ void continueExecution() {
|
|||||||
}
|
}
|
||||||
newData = 1; //exit loop
|
newData = 1; //exit loop
|
||||||
}
|
}
|
||||||
else if (instr >= 224 && instr <= 231) reportBuffer[0] |= (1 << (instr - 224)); // MOD-Keys (en)
|
else if (instr >= 224 && instr <= 231) {
|
||||||
else if (instr >= 232 && instr <= 239) reportBuffer[0] &= ~(1 << (instr - 232)); // MOD-Keys (dis)
|
//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.
|
// 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
|
/* OLD PART FOR MOD-KEYS: Replaced by new command set
|
||||||
New one is independent from mode
|
New one is independent from mode
|
||||||
|
Loading…
Reference in New Issue
Block a user