handle Windows key on windows (Mod4Mask)

This commit is contained in:
stefan schippers 2023-09-27 21:15:25 +02:00
parent ba00ba2921
commit 6c4c8b3a50
2 changed files with 7 additions and 0 deletions

View File

@ -2640,6 +2640,8 @@ int Tcl_AppInit(Tcl_Interp *inter)
/* pass to tcl values of Alt, Shift, COntrol key masks so bind Alt-KeyPress events will work for windows */
#ifndef __unix__
my_snprintf(tmp, S(tmp), "%d", Mod4Mask);
tclsetvar("Mod4Mask", tmp);
my_snprintf(tmp, S(tmp), "%d", Mod1Mask);
tclsetvar("Mod1Mask", tmp);
my_snprintf(tmp, S(tmp), "%d", ShiftMask);

View File

@ -5784,6 +5784,11 @@ global env has_x OS autofocus_mainwindow
# on Windows Alt key mask is reported as 131072 (1<<17) so build masks manually with values passed from C code
if {$OS == "Windows" } {
bind $topwin <Mod4-KeyPress> {xschem callback %W %T %x %y 0 %b 0 [expr {$Mod4Mask}]}
bind $topwin <Shift-Mod4-KeyPress> {xschem callback %W %T %x %y 0 %b 0 [expr {$ShiftMask + $Mod4Mask}]}
bind $topwin <Control-Mod4-KeyPress> {xschem callback %W %T %x %y 0 %b 0 [expr {$ControlMask + $Mod4Mask}]}
bind $topwin <Alt-Mod4-KeyPress> {xschem callback %W %T %x %y 0 %b 0 [expr {$Mod1Mask + $Mod4Mask}]}
bind $topwin <Mod4-KeyPress> {xschem callback %W %T %x %y 0 %b 0 [expr {$Mod4Mask}]}
bind $topwin <Alt-ButtonPress> {xschem callback %W %T %x %y 0 %b 0 [expr {$Mod1Mask}]}
bind $topwin <Control-Alt-ButtonPress> {xschem callback %W %T %x %y 0 %b 0 [expr {$ControlMask + $Mod1Mask}]}
bind $topwin <Shift-Alt-ButtonPress> {xschem callback %W %T %x %y 0 %b 0 [expr {$ShiftMask + $Mod1Mask}]}