File: key.tcl

package info (click to toggle)
circus 0.43-1
  • links: PTS
  • area: non-free
  • in suites: hamm, potato, slink
  • size: 1,868 kB
  • ctags: 236
  • sloc: tcl: 6,574; sh: 157; ansic: 66; makefile: 36
file content (56 lines) | stat: -rw-r--r-- 921 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# Some systems have problems with backspace/delete keys.. *sigh*

bind Entry <Delete> {
   if [%W selection present] {
      %W delete sel.first sel.last
   } else {
      tkEntryBackspace %W
   }
}

bind Text <Delete> {
   if {[%W tag nextrange sel 1.0 end] != ""} {
      %W delete sel.first sel.last
   } elseif [%W compare insert != 1.0] {
      %W delete insert-1c
      %W see insert
   }
}      

#
# Keys for inserting ^B ^V ^_ and ^O for bold, inverse, underline and reset

bind Entry <Control-b> {
	%W insert insert \x02
}

bind Entry <Control-c> {
	%W insert insert \x03
}

bind Entry <Control-g> {
	%W insert insert \x07
}

bind Entry <Control-o> {
	%W insert insert \x0f
}

bind Entry <Control-v> {
	%W insert insert \x16
}

bind Entry <Shift-Control-underscore> {
	%W insert insert \x1f
}

#
# More emacs-like stuff

bind Entry <Control-u> {
    if !$tk_strictMotif {
            %W delete 0 end
    }
}