Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Keyboard-macros/Tcl/keyboard-macros-1.tcl
Normal file
8
Task/Keyboard-macros/Tcl/keyboard-macros-1.tcl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
package require Tk
|
||||
# Show off some emacs-like bindings...
|
||||
pack [label .l -text "C-x C-s to save, C-x C-c to quit"]
|
||||
focus .
|
||||
bind . <Control-x><Control-s> {
|
||||
tk_messageBox -message "We would save here"
|
||||
}
|
||||
bind . <Control-x><Control-c> {exit}
|
||||
5
Task/Keyboard-macros/Tcl/keyboard-macros-2.tcl
Normal file
5
Task/Keyboard-macros/Tcl/keyboard-macros-2.tcl
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
bind . <F1> {
|
||||
foreach c [split "Macro demo!" {}] {
|
||||
event generate %W $c
|
||||
}
|
||||
}
|
||||
16
Task/Keyboard-macros/Tcl/keyboard-macros-3.tcl
Normal file
16
Task/Keyboard-macros/Tcl/keyboard-macros-3.tcl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package require Tk
|
||||
proc sendMacro {w string} {
|
||||
foreach c [split $string {}] {
|
||||
# Will not work for “<” character...
|
||||
event generate $w $c
|
||||
}
|
||||
}
|
||||
proc macro {key translation} {
|
||||
bind . <$key> [list sendMacro %W [string map {% %%} $translation]]
|
||||
}
|
||||
|
||||
# Some demonstration macros
|
||||
macro F1 "Help me!"
|
||||
macro F2 "You pressed the F2 key"
|
||||
macro F3 "I'm getting bored here..."
|
||||
pack [text .t]; # A place for you to test the macros
|
||||
Loading…
Add table
Add a link
Reference in a new issue