Saturday, March 20, 2021

Getting Keyboard Lock and Overwrite Settings

 


 

 

 

#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

if { [catch { package present Gnocl } ] } { package require Gnocl }

set win [gnocl::window -child [gnocl::text -name txt] -setSize 0.25]

exec xmodmap -e "add mod3 = Scroll_Lock"

txt configure -onKeyRelease {

    lassign [gnocl::keyboard %w] NumLock CapsLock ScrollLock
    set Overwrite [%w cget -overwrite]
    
    foreach item {NumLock CapsLock ScrollLock Overwrite} {
        puts "$item   [set $item]"
    }
    
}

No comments: