1 proc read_hotkey_file {} {
3 if {![file exists $CONFIGDIR/hotkeys]} return
4 set f [open $CONFIGDIR/hotkeys]
6 while {[gets $f line]>=0} {
7 regsub {#.*$} $line {} command
8 if {[regexp {^\s*$} $command]} continue
9 if {[regexp {((Key|Mouse)\s+(\(\S+\))?\s*(\w+)\s+([ARWSDT\[\]-_F<^>vI0-9F]+)\s+([NCSMLA]+))\s+(\S.*$)} $command match keydescr k w key c m cmd]} {
10 puts stderr "$keydescr SendToModule *fubar* $cmd"
11 ::fvwm::send "$keydescr SendToModule *fubar* $cmd"
14 append errors "\nUnrecognized syntax: $line"
19 ::fvwm::bind String interpet_hotkeys
20 ::fvwm::setMask {String}
22 if {[info exists errors]} {
23 after idle [list error $errors]
28 proc interpret_hotkeys {event_type id len message} {
29 set cmd hotkey_[string trim message]
30 puts stderr "Hotkey $event_type $id $len $message"
31 if [llength [info proc [lindex $cmd 0]]] {
34 set widget .[lindex $message 0]
35 if {![winfo exists $widget]} {
38 switch {[winfo class $widget]} {
40 Menubutton {uplevel #0 $widget invoke}
42 event generate $widget <Button-1>
48 proc hotkey_menu {{menu_path {}}} {
49 if {![string length $menu_path]} {
54 proc hotkey_find {{menu_path {}}} {
55 if {![string length $menu_path]} {
58 $find.m invoke $menu_path