mirror of https://github.com/gdamore/tcell.git
Don't set modifiers for AltGr on Windows
AltGr is the same as ctrl+alt, and we don't want those to be set when you press a key using AltGr.
This commit is contained in:
parent
337e381927
commit
96e2990564
|
@ -599,13 +599,18 @@ func geti16(v []byte) int16 {
|
||||||
func mod2mask(cks uint32) ModMask {
|
func mod2mask(cks uint32) ModMask {
|
||||||
mm := ModNone
|
mm := ModNone
|
||||||
// Left or right control
|
// Left or right control
|
||||||
if (cks & (0x0008 | 0x0004)) != 0 {
|
ctrl := (cks & (0x0008 | 0x0004)) != 0
|
||||||
|
// Left or right alt
|
||||||
|
alt := (cks & (0x0002 | 0x0001)) != 0
|
||||||
|
// Filter out ctrl+alt (it means AltGr)
|
||||||
|
if !(ctrl && alt) {
|
||||||
|
if ctrl {
|
||||||
mm |= ModCtrl
|
mm |= ModCtrl
|
||||||
}
|
}
|
||||||
// Left or right alt
|
if alt {
|
||||||
if (cks & (0x0002 | 0x0001)) != 0 {
|
|
||||||
mm |= ModAlt
|
mm |= ModAlt
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Any shift
|
// Any shift
|
||||||
if (cks & 0x0010) != 0 {
|
if (cks & 0x0010) != 0 {
|
||||||
mm |= ModShift
|
mm |= ModShift
|
||||||
|
|
Loading…
Reference in New Issue