Thread View: fj.lang.tcl
4 messages
4 total messages
Started by Motomu Nakashima o-2417
Tue, 02 Dec 1997 00:00
[Q] How to distinguish "a" and "Alt-a" on bind command?
Author: Motomu Nakashima o-2417
Date: Tue, 02 Dec 1997 00:00
Date: Tue, 02 Dec 1997 00:00
27 lines
1697 bytes
1697 bytes
$BCfEg!wEl9)Bg$H?=$7$^$9!%(B
Tcl7.6jp/Tk4.2jp $B>e$G(B Tk $B%"%W%j$r:n$C$F$$$k$N$G$9$,!$(B
bind $B%3%^%s%I$K$*$$$F!$(B"a" $B$H(B "Alt-a" ($B$b$7$/$O(B "Ctrl-a"$B$J$I(B)$B$r(B
$B6hJL$7$FJL!9$N(B procedure $B$r<B9T$5$;$k$K$O$I$&$9$l$PNI$$$N$G$7$g(B
$B$&$+!)(B
$BNc$($P!$(B
bind .foo <a> { honya }
bind .foo <Alt-a> { munya }
$B$H=q$$$?$H$7$^$9!%$3$l$O!$(Ba $B%-!<$r2!$7$?;~$O(B honya $B$r<B9T!$(B
Alt $B%-!<$r2!$7$J$,$i(B a $B$r2!$7$?;~$O(B munya $B$r<B9T!$$H$$$&F0:n$r(B
$B4|BT$7$F$$$^$9!%(B
$B$H$3$m$,<B:]$O!$(Ba $B%-!<$r2!$7$?;~$O(B honya $B$@$1$,<B9T$5$l$^$9$,!$(B
Alt $B%-!<$r2!$7$J$,$i(B a $B%-!<$r2!$9$H!$(Bhonya $B$H(B munya $B$NN>J}$,(B
$B<B9T$5$l$F$7$^$$$^$9!%(B
$B3N$+$K!$$3$l$O$3$l$G(B reasonable $B$@$H$O;W$&$N$G$9$,!$$=$l$J$i$P!$(B
<only-a> $B$_$?$$$J(B (^^; $B9%ET9g$J%$%Y%s%HL>$OL5$$$s$G$7$g$&$+(B...
-----------------------------
$BCfEg!!5a(B Motomu Nakashima
$BEl5~9)6HBg3X(B $B5!3#2J3X2J(B Dept. of Mech. Eng.& Science
$B1?F0@)8f3X9V:B(B Tokyo Institute of Technology
Fingerprint: 0D E6 6B 56 2A 98 A7 61 0A 38 33 43 BA C3 97 1D
Re: [Q] How to distinguish "a" and "Alt-a" on bind command?
Author: kuno
Date: Tue, 02 Dec 1997 00:00
Date: Tue, 02 Dec 1997 00:00
21 lines
1271 bytes
1271 bytes
$B5WLn$G$9!#(B
$BCfEg$5$s(B:
> $B$H$3$m$,<B:]$O!$(Ba $B%-!<$r2!$7$?;~$O(B honya $B$@$1$,<B9T$5$l$^$9$,!$(B
> Alt $B%-!<$r2!$7$J$,$i(B a $B%-!<$r2!$9$H!$(Bhonya $B$H(B munya $B$NN>J}$,(B
> $B<B9T$5$l$F$7$^$$$^$9!%(B
> $B3N$+$K!$$3$l$O$3$l$G(B reasonable $B$@$H$O;W$&$N$G$9$,!$$=$l$J$i$P!$(B
> <only-a> $B$_$?$$$J(B (^^; $B9%ET9g$J%$%Y%s%HL>$OL5$$$s$G$7$g$&$+(B...
$B$J$$$G$9$,!"(Bbind$B$5$l$kJ8;zNs$K!V(B%s$B!W$rF~$l$F$*$1$P$3$l$K(Bstatus
$B>pJs(B($B$3$N>l9g$O$I$N%b%G%#%U%!%$%"%-!<$,2!$5$l$F$$$k$+$N>pJs(B)$B$,F~(B
$B$k$N$G!"(B
bind .foo { honya %s }
$B$H$+$7$H$$$F!"(Bhonya$B$NCf$GBh(B1$B0z?t$,(B0$B$N;~0J30$O2?$b$;$:$KLa$k$H$+(B
$B$7$F$O$I$&$G$7$g$&$+!#(B
$B$"$s$^$jH~$7$/$O$J$$$G$9$M(B $B5WLn(B
Re: [Q] How to distinguish "a" and "Alt-a" on bind command?
Author: Motomu Nakashima o-2417
Date: Wed, 03 Dec 1997 00:00
Date: Wed, 03 Dec 1997 00:00
134 lines
4762 bytes
4762 bytes
$BCfEg!wEl9)Bg$G$9!%<+8J%U%)%m!<$G$9!%(B
In article <MNAKASHI.97Dec2161944@cpus-f0.cc.titech.ac.jp>, I Wrote:
> Tcl7.6jp/Tk4.2jp $B>e$G(B Tk $B%"%W%j$r:n$C$F$$$k$N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) $B$"$k(B widget $B$K$*$$$F(B <Alt-a> $B$J$I$N(B modifier $BIU$-$N(B binding
$B$O@_Dj$5$l$F$$$J$/!$(B<a> $B$K$N$_@_Dj$7$F$"$k>l9g!$(B"Alt" + "a"
$B$J$I$NF~NO$G$b(B <a> $B$K@_Dj$7$F$"$kF0:n$,<B9T$5$l$k!%(B
(ii) $B$7$+$7!$F10l(B widget $B>e$G(B modifier $BIU$-$H(B modifier $BL5$7$N(B
binding $B$,N>J}$"$k>l9g$K$O6hJL$5$l!$(B"Alt" + "a" $B$rF~NO$7$F$b(B
<a> $B$G@_Dj$7$F$$$kF0:n$O<B9T$5$l$J$$!%(B
$B$H$$$&$3$H$G$9$M!%(B(i) $B$N;EMM$K$O5$IU$+$J$+$C$?$G$9!%(B
$B$$$o$f$k!V$"$$$^$$$J(B binding$B!W$C$F$d$D$G$7$g$&$+!%(B
$B;d$,Ax6x$7$?>e$N(B(2)$B$N>l9g$K$O!$(B
--------------------
"a" $B$rF~NO$7$?>l9g!'(B
--------------------
.foo $B$G$N(B binding $B$N$?$a!$(Bhonya $B$,<B9T(B
---------------------------
"Alt"+ "a" $B$rF~NO$7$?>l9g!'(B
---------------------------
.foo $B$G$N(B binding $B$N$?$a(B honya $B$,<B9T(B
($BM}M3!';EMM(B (i) $B$N$?$a(B)
. $B$G$N(B binding $B$N$?$a(B munya $B$,<B9T(B
($BM}M3!'(B.foo $B$N(B bindtags $B$K(B . $B$,4^$^$l$F$$$k$?$a(B)
$B$H$J$C$F$$$?$H$$$&$3$H$N$h$&$G$9!%(B
-----------------------------
$BCfEg!!5a(B Motomu Nakashima
$BEl5~9)6HBg3X(B $B5!3#2J3X2J(B Dept. of Mech. Eng.& Science
$B1?F0@)8f3X9V:B(B Tokyo Institute of Technology
Fingerprint: 0D E6 6B 56 2A 98 A7 61 0A 38 33 43 BA C3 97 1D
---- $B%-!<F~NO$r@Z$jJ,$1$k(B script ($B0J2<%a!<%k86J8$+$i0zMQ(B) -----
$B0J2<$NMM$K$9$k$H3N<B$K5/F0$N@Z$jJ,$1$,=PMh$k$H;W$$$^$9!#(B
$BC"$7!"(Bemacs,mule$B$NMM$K(BM-c-x$B$NMM$J$3$H$O=q$-49$($,I,MW$G$9!#(B
-----------------------------------------------
set ctrl_handle(a) "ctrl_a"
set ctrl_handle(b) "ctrl_b"
set KeyHandle(modifier) none
bind . <Any-KeyRelease> {
global KeyHandle
switch -glob %K {
Control* {
set KeyHandle(modifier) none
}
Alt* {
set KeyHandle(modifier) none
}
default {
}
}
}
bind . <Any-KeyPress> {
global modifier edit_mode
switch -glob %K {
Control* {
# Control_L Control_R Control
set KeyHandle(modifier) %K
}
Alt* {
# Alt_L Alt_R Alt
set KeyHandle(modifier) %K
}
[a-z] {
# with modifier
switch -glob $KeyHandle(modifier) {
Control* {
if {[info exists ctrl_handle]} {
global ctrl_handle
if {[lsearch -glob [array names ctrl_handle] %K ]>=0} {
eval $ctrl_handle(%K)
}
}
}
Alt* {
if {[info exists alt_handle]} {
global alt_handle
if {[lsearch -glob [array names alt_handle] %K ]>=0} {
eval $alt_handle(%K)
}
}
}
default {
}
}
}
}
}
-----------------------------------------------
Re: [Q] How to distinguish "a" and "Alt-a" on bind command?
Author: Toshihiko Haga
Date: Wed, 03 Dec 1997 00:00
Date: Wed, 03 Dec 1997 00:00
30 lines
1724 bytes
1724 bytes
> bind .foo <a> { honya }
> bind .foo <Alt-a> { munya }
>
> $B$H=q$$$?$H$7$^$9!%$3$l$O!$(Ba $B%-!<$r2!$7$?;~$O(B honya $B$r<B9T!$(B
> Alt $B%-!<$r2!$7$J$,$i(B a $B$r2!$7$?;~$O(B munya $B$r<B9T!$$H$$$&F0:n$r(B
> $B4|BT$7$F$$$^$9!%(B
>
> $B$H$3$m$,<B:]$O!$(Ba $B%-!<$r2!$7$?;~$O(B honya $B$@$1$,<B9T$5$l$^$9$,!$(B
> Alt $B%-!<$r2!$7$J$,$i(B a $B%-!<$r2!$9$H!$(Bhonya $B$H(B munya $B$NN>J}$,(B
> $B<B9T$5$l$F$7$^$$$^$9!%(B
> $B3N$+$K!$$3$l$O$3$l$G(B reasonable $B$@$H$O;W$&$N$G$9$,!$$=$l$J$i$P!$(B
> <only-a> $B$_$?$$$J(B (^^; $B9%ET9g$J%$%Y%s%HL>$OL5$$$s$G$7$g$&$+(B...
bind$B$N%^%K%e%"%k$N(BMULTIPLE MATCHES$B@a$K<!$N5-=R$,$"$j$^$9!#(B
If more than one binding matches a particular event and they |
have the same tag, then the most specific binding is chosen |
and its script is evaluated.
$B@[Lu(B
$BJ#?t$N%P%$%s%G%#%s%0$,FCDj$N%$%Y%s%H$KE,9g$7!"$=$l$i$,F1$8%?%0(B
$B$r;}$C$F$$$k$H!"$b$C$H$b8BDjE*$J%P%$%s%G%#%s%0$,A*Br$5$l!"$=$N(B
$B%9%/%j%W%H$,I>2A$5$l$k!#(B
$B$3$l$r8+$k8B$j$G$O7o$N%3!<%I$GLdBj$J$$$h$&$K;W$($k$N$G$9$,!"(B
$B;d$J$K$+4*0c$$$7$F$^$9!)(B
$BK'2l(B
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads