- ]4 w# J" M; Z& ]5 t # l+ p; e8 e( v& I+ l x$ j LAssign shortcut keys to a command " x: C" v0 O6 O4 J4 kYou can assign shortcut keys to the PCB application commands. All these functionalities are provided by the key binding server. The sample script KeyBindings.vbs shows how to use the key binding server to assign shortcut keys.) d4 ]2 L! f0 ]0 M
/ L( I3 O/ `) z8 J$ m) K' m ! O4 [ u2 d" ^9 \( p& x: S$ v# j; m3 a# o& m( O. _
/ ]5 j8 D( G* b" ]. f% n; s
3 T/ J7 `1 ?# F- z9 I5 I8 @
Shortcut keys modifiers 2 l, V+ X9 j/ X) STo assign shortcut keys, the following modifiers exist for key combinations such as: - ]2 p6 s3 g! S7 e4 b ' H2 T. e9 Q. F9 ~<key>% V) i5 q: l: R( y( R3 N" E
9 k8 q# T8 {$ n" w- ]4 w7 nAlt+<key>3 k& i4 p. @% l; U, ~! L. [' C
8 U- P: N0 Z& CCtrl+<key>: R" }' r8 `/ u) X/ v" p ]$ A% K9 d
6 y k/ G0 z; F& X. Z" ?
Alt+Shift+<key> 3 p; Z* u. L5 i& ?' N; L0 R$ \- D; i# R
Ctrl+Shift+<key>0 u! y% z x/ O/ E6 B3 g
* G- X( q* E' N4 |
Ctrl+Alt+Shift+<key> ( ]* V, Z) y) l8 r' [+ V # D: y' l- e% twhere <key> is the keyname such as: Enter, Space, A-Z, 0-9, F1-F12. Note that do not override any of the existing function keys (F1-F12) without using a modifier or that functionality will be disabled in the product. 8 A* |# m5 g4 [9 x' y" R+ Y* k% _6 }2 Z5 [9 Y
" @1 n* L5 ]6 G" {3 T) u
: s4 |* Z3 s1 d# Y
% [, l$ g3 \! d, b( D) t0 e! X4 f( N 1 p d% J* P1 U6 c# yConnecting to the key binding server0 d+ r5 q! W7 q5 z- H7 ]- Z A& Z
The Bindings property of the Gui object returns a reference to the BindingTables collection object and from which you can start assigning shortcut keys. The following example returns the BindingTables used when design is loaded : 7 B/ d+ r' j4 u# Q6 ?1 @+ J7 Y s
" d8 V( I0 M; W( y! { 2 ?/ i# E/ S+ }( l n( D, a$ n' D K4 N$ |0 V* [7 f+ b
Set keyBindTables = Gui.Bindings("Document"): m4 |9 j7 {5 @& ]- T w
6 T- h' B: j. o( ~: E9 F . M+ I) X8 r0 d4 T; `* r0 O& P. S5 _/ M/ g; W/ y
$ T3 G! d% ~" j1 R- s; |% d 8 X+ _, F o1 ^* B# t9 m8 BAssigning shortcut keys to menu command " D. a* U) o0 w% e/ a8 \3 L! O7 y' T2 [The AddKeyBinding method of the BindingTables collection object allows you to assign shortcut keys to any menu command. The following example shows the use of the AddKeyBinding method to assign shortcut keys to some menu commands : 0 V3 ^% D6 o+ a: V5 h, j% K) {. K, {4 o5 m. t
. t5 J" ]) Q8 s. K3 a0 `1 ~1 W ]+ m/ w* `+ A% [' H
O+ p3 d `- e( n- d8 U& n $ y3 f+ ~7 N! {1 ^( pAssigning shortcut keys to user-defined scripts% z. c4 A/ u7 C5 }, ^/ o0 q
You can also assign shortcut keys to your own scripts. In the Command parameter of the AddKeyBinding method, type in your script filename as if it is ran as a key-in command : ' c/ U2 Q6 l, N1 s% S! n6 `
; j3 {2 k. F2 L. h; C! I6 M 6 _! q' y! \1 Z& [1 @' t3 ]
6 i( \0 ~( T) ^
keyBindTables.AddKeyBinding "Ctrl+3", "run c:/temp/ctrl_3.vbs", BindCommand, BindAccelerator : Q1 E+ [3 V) P& ]8 S ( y. B* ]# j6 Q8 `! O keyBindTables.AddKeyBinding "Alt+X", "run c:/temp/alt_x.vbs", BindCommand, BindAccelerator & C9 I# Z; K) o& ~" ^ ; k4 p* y. c0 C- g' c4 j keyBindTables.AddKeyBinding "Ctrl+Alt+Shift+5", "run c:/temp/ctrl_alt_shift_5.vbs", BindCommand, BindAccelerator