From 6c4c8b3a503dd91f4a3b59bda71feb9ec07ea06b Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Wed, 27 Sep 2023 21:15:25 +0200 Subject: [PATCH] handle Windows key on windows (Mod4Mask) --- src/xinit.c | 2 ++ src/xschem.tcl | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/xinit.c b/src/xinit.c index 54bcf83f..6193d260 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -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); diff --git a/src/xschem.tcl b/src/xschem.tcl index c1cf947f..cd9efc0c 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -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 {xschem callback %W %T %x %y 0 %b 0 [expr {$Mod4Mask}]} + bind $topwin {xschem callback %W %T %x %y 0 %b 0 [expr {$ShiftMask + $Mod4Mask}]} + bind $topwin {xschem callback %W %T %x %y 0 %b 0 [expr {$ControlMask + $Mod4Mask}]} + bind $topwin {xschem callback %W %T %x %y 0 %b 0 [expr {$Mod1Mask + $Mod4Mask}]} + bind $topwin {xschem callback %W %T %x %y 0 %b 0 [expr {$Mod4Mask}]} bind $topwin {xschem callback %W %T %x %y 0 %b 0 [expr {$Mod1Mask}]} bind $topwin {xschem callback %W %T %x %y 0 %b 0 [expr {$ControlMask + $Mod1Mask}]} bind $topwin {xschem callback %W %T %x %y 0 %b 0 [expr {$ShiftMask + $Mod1Mask}]}