mirror of https://github.com/adamdruppe/arsd.git
ketmar key name patch
This commit is contained in:
parent
c70ce55098
commit
a2b40b5b46
|
@ -3664,13 +3664,18 @@ struct KeyEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void putMod (ModifierState mod, Key key, string text) nothrow @trusted {
|
||||||
|
if ((this.modifierState&mod) != 0 && (this.pressed || this.key != key)) put(text);
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.key && !(this.modifierState&(ModifierState.ctrl|ModifierState.alt|ModifierState.shift|ModifierState.windows))) return null;
|
if (!this.key && !(this.modifierState&(ModifierState.ctrl|ModifierState.alt|ModifierState.shift|ModifierState.windows))) return null;
|
||||||
|
|
||||||
// put modifiers
|
// put modifiers
|
||||||
if (this.modifierState&ModifierState.ctrl) put("Ctrl+");
|
// releasing modifier keys can produce bizarre things like "Ctrl+Ctrl", so hack around it
|
||||||
if (this.modifierState&ModifierState.alt) put("Alt+");
|
putMod(ModifierState.ctrl, Key.Ctrl, "Ctrl+");
|
||||||
if (this.modifierState&ModifierState.windows) put("Win+");
|
putMod(ModifierState.alt, Key.Alt, "Alt+");
|
||||||
if (this.modifierState&ModifierState.shift) put("Shift+");
|
putMod(ModifierState.windows, Key.Shift, "Windows+");
|
||||||
|
putMod(ModifierState.shift, Key.Shift, "Shift+");
|
||||||
|
|
||||||
if (this.key) {
|
if (this.key) {
|
||||||
foreach (string kn; __traits(allMembers, Key)) {
|
foreach (string kn; __traits(allMembers, Key)) {
|
||||||
|
|
Loading…
Reference in New Issue