ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/Macro.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/Macro.pm (file contents):
Revision 1.3 by root, Sat Dec 9 22:06:51 2006 UTC vs.
Revision 1.22 by root, Sat Apr 3 02:58:24 2010 UTC

1package CFPlus::Macro; 1package DC::Macro;
2 2
3use strict; 3use common::sense;
4 4
5use List::Util ();
5use CFPlus::UI; 6use DC::UI;
6 7
7our $REFRESH_MACRO_LIST; 8our $REFRESH_MACRO_LIST;
9
10our %DEFAULT_KEYMAP = (
11 (map +("($_)" => "!completer $_"), "a" .. "z"),
12 "(!)" => "!completer shout ",
13 "(\")" => "!completer say ",
14 "(')" => "!completer",
15
16# "LShift-tab" => "!toggle-messagewindow",
17# "RShift-tab" => "!toggle-messagewindow",
18 "tab" => "!toggle-playerbook",
19 "f1" => "!toggle-help",
20 "f2" => "!toggle-stats",
21 "f3" => "!toggle-skills",
22 "f4" => "!toggle-spells",
23 "f5" => "!toggle-inventory",
24 "f9" => "!toggle-setup",
25
26 (map +("LRAM-$_" => "!switch-tab $_"), 0..9),
27 "LRAM-x" => "!close-current-tab",
28
29 "return" => "!activate-chat",
30 "." => "!repeat-command",
31
32 "," => "take",
33 "space" => "apply",
34 "enter" => "examine",
35 "[+]" => "rotateshoottype +",
36 "[-]" => "rotateshoottype -",
37
38 "LRAM-e" => "examine",
39 "LRAM-s" => "ready_skill find traps",
40 "LRAM-d" => "ready_skill disarm traps",
41 "LRAM-p" => "ready_skill praying",
42);
8 43
9# allowed modifiers 44# allowed modifiers
10our %MODIFIER = ( 45our %MODIFIER = (
11 "LShift" => CFPlus::KMOD_LSHIFT, 46 "LShift" => DC::KMOD_LSHIFT,
12 "RShift" => CFPlus::KMOD_RSHIFT, 47 "RShift" => DC::KMOD_RSHIFT,
48# "Shift" => DC::KMOD_LSHIFT | DC::KMOD_RSHIFT,
13 "LCtrl" => CFPlus::KMOD_LCTRL, 49 "LCtrl" => DC::KMOD_LCTRL,
14 "RCtrl" => CFPlus::KMOD_RCTRL, 50 "RCtrl" => DC::KMOD_RCTRL,
51# "Ctrl" => DC::KMOD_LCTRL | DC::KMOD_RCTRL,
15 "LAlt" => CFPlus::KMOD_LALT, 52 "LAlt" => DC::KMOD_LALT,
16 "RAlt" => CFPlus::KMOD_RALT, 53 "RAlt" => DC::KMOD_RALT,
54# "Alt" => DC::KMOD_LALT | DC::KMOD_RALT,
17 "LMeta" => CFPlus::KMOD_LMETA, 55 "LMeta" => DC::KMOD_LMETA,
18 "RMeta" => CFPlus::KMOD_RMETA, 56 "RMeta" => DC::KMOD_RMETA,
57# "Meta" => DC::KMOD_LMETA | DC::KMOD_RMETA,
19); 58);
20 59
21# allowed modifiers 60# allowed modifiers
22our $MODIFIER_MASK |= $_ for values %MODIFIER; 61our $MODIFIER_MASK |= $_ for values %MODIFIER;
23 62
24# can bind to these without any modifier 63# can bind to these without any modifier
25our @DIRECT_CHARS = qw(0 1 2 3 4 5 6 7 8 9); 64our @DIRECT_CHARS = qw(0 1 2 3 4 5 6 7 8 9);
26 65
27our @DIRECT_KEYS = ( 66our @DIRECT_KEYS = (
28 CFPlus::SDLK_F1, 67 DC::SDLK_F1,
29 CFPlus::SDLK_F2, 68 DC::SDLK_F2,
30 CFPlus::SDLK_F3, 69 DC::SDLK_F3,
31 CFPlus::SDLK_F4, 70 DC::SDLK_F4,
32 CFPlus::SDLK_F5, 71 DC::SDLK_F5,
33 CFPlus::SDLK_F6, 72 DC::SDLK_F6,
34 CFPlus::SDLK_F7, 73 DC::SDLK_F7,
35 CFPlus::SDLK_F8, 74 DC::SDLK_F8,
36 CFPlus::SDLK_F9, 75 DC::SDLK_F9,
37 CFPlus::SDLK_F10, 76 DC::SDLK_F10,
38 CFPlus::SDLK_F11, 77 DC::SDLK_F11,
39 CFPlus::SDLK_F12, 78 DC::SDLK_F12,
40 CFPlus::SDLK_F13, 79 DC::SDLK_F13,
41 CFPlus::SDLK_F14, 80 DC::SDLK_F14,
42 CFPlus::SDLK_F15, 81 DC::SDLK_F15,
43); 82);
83
84our %MACRO_FUNCTION = (
85 "toggle-messagewindow" => sub { $::MESSAGE_WINDOW->toggle_visibility },
86 "toggle-playerbook" => sub { $::PL_WINDOW->toggle_visibility },
87 "toggle-help" => sub { $::HELP_WINDOW->toggle_visibility },
88 "toggle-stats" => sub { ::toggle_player_page ($::STATS_PAGE) },
89 "toggle-skills" => sub { ::toggle_player_page ($::SKILL_PAGE) },
90 "toggle-spells" => sub { ::toggle_player_page ($::SPELL_PAGE) },
91 "toggle-inventory" => sub { ::toggle_player_page ($::INVENTORY_PAGE) },
92 "toggle-pickup" => sub { ::toggle_player_page ($::PICKUP_PAGE) },
93 "toggle-setup" => sub { $::SETUP_DIALOG->toggle_visibility },
94 "toggle-setup" => sub { $::SETUP_DIALOG->toggle_visibility },
95 "switch-tab" => sub { $::MESSAGE_WINDOW->user_switch_to_page (0 + shift) },
96 "close-current-tab" => sub { $::MESSAGE_WINDOW->close_current_tab },
97 "activate-chat" => sub { $::MESSAGE_WINDOW->activate_current },
98 "repeat-command" => sub {
99 $::CONN->user_send ($::COMPLETER->{last_command})
100 if $::CONN && exists $::COMPLETER->{last_command};
101 },
102 "completer" => sub {
103 if ($::CONN) {
104 $::COMPLETER->set_prefix (shift);
105 $::COMPLETER->show;
106 }
107 },
108);
109
110our $DEFAULT_KEYMAP;
111
112sub init {
113 $DEFAULT_KEYMAP ||= do {
114 local $MODIFIER{LRAM} = DC::KMOD_LRAM; # hack to enable internal LRAM modifer
115
116 my %sym = map +(DC::SDL_GetKeyName $_, $_), DC::SDLK_FIRST .. DC::SDLK_LAST;
117 my $map;
118
119 while (my ($k, $v) = each %DEFAULT_KEYMAP) {
120 if ($k =~ /^\((.)\)$/) {
121 $map->{U}{ord $1} = $v;
122 } else {
123 my @mod = split /-/, $k;
124 my $sym = $sym{pop @mod}
125 or warn "unknown keysym $k\n";
126
127 my $mod = 0; $mod |= $MODIFIER{$_} for @mod;
128
129 $map->{K}[DC::popcount $mod]{$mod}{$sym} = $v;
130 }
131 }
132
133 %DEFAULT_KEYMAP = ();
134 $map
135 };
136}
44 137
45sub accelkey_to_string($) { 138sub accelkey_to_string($) {
46 join "-", 139 join "-",
47 (grep $_[0][0] & $MODIFIER{$_}, 140 (grep $_[0][0] & $MODIFIER{$_}, keys %MODIFIER),
48 keys %MODIFIER),
49 CFPlus::SDL_GetKeyName $_[0][1] 141 DC::SDL_GetKeyName $_[0][1]
50} 142}
51 143
52sub trigger_to_string($) { 144sub trigger_to_string($) {
53 my ($macro) = @_; 145 my ($macro) = @_;
54 146
81 $window->disconnect_all ("focus_out"); 173 $window->disconnect_all ("focus_out");
82 $window->destroy; 174 $window->destroy;
83 &$end_cb; 175 &$end_cb;
84 }; 176 };
85 177
86 $window = new CFPlus::UI::Toplevel 178 $window = new DC::UI::Toplevel
87 title => "Edit Macro Trigger", 179 title => "Edit Macro Trigger",
88 x => "center", 180 x => "center",
89 y => "center", 181 y => "center",
90 z => 1000, 182 z => 1000,
91 can_events => 1, 183 can_events => 1,
99 $done->(0); 191 $done->(0);
100 1 192 1
101 }, 193 },
102 ; 194 ;
103 195
104 $window->add (my $vb = new CFPlus::UI::VBox); 196 $window->add (my $vb = new DC::UI::VBox);
105 197
106 $vb->add (new CFPlus::UI::Label 198 $vb->add (new DC::UI::Label
107 text => "To bind the macro to a key,\n" 199 text => "To bind the macro to a key,\n"
108 . "press a modifier (Ctrl, Alt\n" 200 . "press a modifier (Ctrl, Alt\n"
109 . "and/or Shift) and a key, or\n" 201 . "and/or Shift) and a key, or\n"
110 . "0-9 and F1-F15 without any modifier\n\n" 202 . "0-9 and F1-F15 without any modifier\n\n"
111 . "To cancel press Escape or close this.\n\n" 203 . "To cancel press Escape or close this.\n\n"
112 . "Accelerator key combo:", 204 . "Accelerator key combo:",
113 ellipsise => 0, 205 ellipsise => 0,
114 ); 206 );
115 207
116 $vb->add (my $entry = new CFPlus::UI::Label 208 $vb->add (my $entry = new DC::UI::Label
117 fg => [0, 0, 0, 1], 209 fg => [0, 0, 0, 1],
118 bg => [1, 1, 0, 1], 210 bg => [1, 1, 0, 1],
119 ); 211 );
120 212
121 my $key_cb = sub { 213 my $key_cb = sub {
134 map "$_-", 226 map "$_-",
135 grep $mod & $MODIFIER{$_}, 227 grep $mod & $MODIFIER{$_},
136 keys %MODIFIER 228 keys %MODIFIER
137 ); 229 );
138 230
139 return if $sym >= CFPlus::SDLK_MODIFIER_MIN 231 return if $sym >= DC::SDLK_MODIFIER_MIN
140 && $sym <= CFPlus::SDLK_MODIFIER_MAX; 232 && $sym <= DC::SDLK_MODIFIER_MAX;
141 233
142 if ($mod 234 if ($mod
143 || ((grep $_ eq chr $ev->{unicode}, @DIRECT_CHARS) 235 || ((grep $_ eq chr $ev->{unicode}, @DIRECT_CHARS)
144 || (grep $_ == $sym, @DIRECT_KEYS))) 236 || (grep $_ == $sym, @DIRECT_KEYS)))
145 { 237 {
146 $macro->{accelkey} = [$mod, $sym]; 238 $macro->{accelkey} = [$mod, $sym];
147 $done->(1); 239 $done->(1);
148 } else { 240 } else {
149 $entry->set_text ("cannot bind " . (CFPlus::SDL_GetKeyName $sym) . " without modifier."); 241 $entry->set_text ("cannot bind " . (DC::SDL_GetKeyName $sym) . " without modifier.");
150 } 242 }
151 1 243 1
152 }; 244 };
153 245
154 $window->connect (key_up => $key_cb); 246 $window->connect (key_up => $key_cb);
156 248
157 $window->grab_focus; 249 $window->grab_focus;
158 $window->show; 250 $window->show;
159} 251}
160 252
253sub find_default($) {
254 my ($ev) = @_;
255
256 for my $m (reverse grep $_, @{ $DEFAULT_KEYMAP->{K} }) {
257 for (keys %$m) {
258 if ($_ == ($ev->{mod} & $_)) {
259 if (defined (my $cmd = $m->{$_}{$ev->{sym}})) {
260 return $cmd;
261 }
262 }
263 }
264 }
265
266 if (my $cmd = $DEFAULT_KEYMAP->{U}{$ev->{unicode}}) {
267 return $cmd;
268 }
269
270 ()
271}
272
161# find macro by event 273# find macro by event
162# maybe return multiple results? 274sub find($) {
163sub match_event($) {
164 my ($ev) = @_; 275 my ($ev) = @_;
165 276
166 for my $macro (@{ $::PROFILE->{macro} || [] }) { 277 # try user-defined macros
278 if (my @user =
279 grep {
167 my $key = $macro->{accelkey} 280 if (my $key = $_->{accelkey}) {
168 or next;
169
170 $key->[1] == $ev->{sym} 281 $key->[1] == $ev->{sym}
171 && $key->[0] == ($ev->{mod} & $MODIFIER_MASK) 282 && $key->[0] == ($ev->{mod} & $MODIFIER_MASK)
172 && return $macro; 283 } else {
284 0
285 }
286 } @{ $::PROFILE->{macro} || [] }
287 ) {
288 return @user;
173 } 289 }
174 290
291 # now try default keymap
292 if (defined (my $def = find_default $ev)) {
293 return {
294 action => [$def],
295 };
296 }
297
175 () 298 ()
176} 299}
177 300
301sub execute {
302 my ($macro) = @_;
303
304 for (@{ $macro->{action} }) {
305 if (/^\!(\S+)\s?(.*)$/) {
306 $MACRO_FUNCTION{$1}->($2)
307 if exists $MACRO_FUNCTION{$1};
308 } else {
309 $::CONN->send_command ($_)
310 if $::CONN;
311 }
312 }
313}
314
178sub keyboard_setup { 315sub keyboard_setup {
179 my $kbd_setup = new CFPlus::UI::VBox; 316 my $kbd_setup = new DC::UI::VBox;
180 317
181 $kbd_setup->add (my $list = new CFPlus::UI::VBox); 318 $kbd_setup->add (my $list = new DC::UI::VBox);
182 319
183 $list->add (new CFPlus::UI::FancyFrame 320 $list->add (new DC::UI::FancyFrame
184 label => "Options", 321 label => "Options",
185 child => (my $hb = new CFPlus::UI::HBox), 322 child => (my $hb = new DC::UI::HBox),
186 ); 323 );
187 $hb->add (new CFPlus::UI::Label text => "only shift-up stops fire"); 324 $hb->add (new DC::UI::Label text => "only shift-up stops fire");
188 $hb->add (new CFPlus::UI::CheckBox 325 $hb->add (new DC::UI::CheckBox
189 expand => 1, 326 expand => 1,
190 state => $::CFG->{shift_fire_stop}, 327 state => $::CFG->{shift_fire_stop},
191 tooltip => "If this checkbox is enabled you will stop fire only if you stop pressing shift.", 328 tooltip => "If this checkbox is enabled you will stop fire only if you stop pressing shift.",
192 on_changed => sub { 329 on_changed => sub {
193 my ($cbox, $value) = @_; 330 my ($cbox, $value) = @_;
194 $::CFG->{shift_fire_stop} = $value; 331 $::CFG->{shift_fire_stop} = $value;
195 0 332 0
196 }, 333 },
197 ); 334 );
198 335
199 $list->add (new CFPlus::UI::FancyFrame 336 $list->add (new DC::UI::FancyFrame
200 label => "Bindings", 337 label => "Macros",
201 child => (my $macros = new CFPlus::UI::Table), 338 child => (my $macros = new DC::UI::VBox),
202 ); 339 );
203 340
204 my $refresh; 341 my $refresh;
205 342
206 my $tooltip_common = "\n\n<small>Left click - edit macro\nMiddle click - invoke macro\nRight click - further options</small>"; 343 my $tooltip_common = "\n\n<small>Left click - edit macro\nMiddle click - invoke macro\nRight click - further options</small>";
209 346
210 my $edit_macro = sub { 347 my $edit_macro = sub {
211 my ($macro) = @_; 348 my ($macro) = @_;
212 349
213 $kbd_setup->clear; 350 $kbd_setup->clear;
214 $kbd_setup->add (new CFPlus::UI::Button 351 $kbd_setup->add (new DC::UI::Button
215 text => "Return", 352 text => "Return",
216 tooltip => "Return to the macro list.", 353 tooltip => "Return to the macro list.",
217 on_activate => sub { 354 on_activate => sub {
218 $kbd_setup->clear; 355 $kbd_setup->clear;
219 $kbd_setup->add ($list); 356 $kbd_setup->add ($list);
220 $refresh->(); 357 $refresh->();
221 1 358 1
222 }, 359 },
223 ); 360 );
224 $kbd_setup->add (new CFPlus::UI::FancyFrame 361 $kbd_setup->add (new DC::UI::FancyFrame
225 label => "Edit Macro", 362 label => "Edit Macro",
226 child => (my $editor = new CFPlus::UI::Table col_expand => [0, 1]), 363 child => (my $editor = new DC::UI::Table col_expand => [0, 1]),
227 ); 364 );
228 365
229 $editor->add (0, 1, new CFPlus::UI::Label 366 $editor->add_at (0, 1, new DC::UI::Label
230 text => "Trigger", 367 text => "Trigger",
231 tooltip => $tooltip_trigger, 368 tooltip => $tooltip_trigger,
232 can_hover => 1, 369 can_hover => 1,
233 can_events => 1, 370 can_events => 1,
234 ); 371 );
235 $editor->add (0, 2, new CFPlus::UI::Label 372 $editor->add_at (0, 2, new DC::UI::Label
236 text => "Actions", 373 text => "Actions",
237 tooltip => $tooltip_commands, 374 tooltip => $tooltip_commands,
238 can_hover => 1, 375 can_hover => 1,
239 can_events => 1, 376 can_events => 1,
240 ); 377 );
241 378
242 $editor->add (1, 2, my $textedit = new CFPlus::UI::TextEdit 379 $editor->add_at (1, 2, my $textedit = new DC::UI::TextEdit
243 text => macro_to_text $macro, 380 text => macro_to_text $macro,
244 tooltip => $tooltip_commands, 381 tooltip => $tooltip_commands,
245 on_changed => sub { 382 on_changed => sub {
246 $macro->{action} = macro_from_text $macro, $_[1]; 383 $macro->{action} = macro_from_text $macro, $_[1];
247 }, 384 },
248 ); 385 );
249 386
250 $editor->add (1, 1, my $accel = new CFPlus::UI::Button 387 $editor->add_at (1, 1, my $accel = new DC::UI::Button
251 text => trigger_to_string $macro, 388 text => trigger_to_string $macro,
252 tooltip => "To change the trigger for a macro, activate this button.", 389 tooltip => "To change the trigger for a macro, activate this button.",
253 on_activate => sub { 390 on_activate => sub {
254 my ($accel) = @_; 391 my ($accel) = @_;
255 trigger_edit $macro, sub { 392 trigger_edit $macro, sub {
258 1 395 1
259 }, 396 },
260 ); 397 );
261 398
262 my $recording; 399 my $recording;
263 $editor->add (1, 3, new CFPlus::UI::Button 400 $editor->add_at (1, 3, new DC::UI::Button
264 text => "Start Recording", 401 text => "Start Recording",
265 tooltip => "Start/Stop command recording: when recording, " 402 tooltip => "Start/Stop command recording: when recording, "
266 . "actions and commands you invoke are appended to this macro. " 403 . "actions and commands you invoke are appended to this macro. "
267 . "You can only record when you are logged in.", 404 . "You can only record when you are logged in.",
268 on_destroy => sub { 405 on_destroy => sub {
272 my ($widget) = @_; 409 my ($widget) = @_;
273 410
274 $recording = $::CONN && !$recording; 411 $recording = $::CONN && !$recording;
275 if ($recording) { 412 if ($recording) {
276 $widget->set_text ("Stop Recording"); 413 $widget->set_text ("Stop Recording");
277 my $action = $macro->{action} ||= [];
278 $::CONN->record (sub { 414 $::CONN->record (sub {
279 push @$action, $_[0]; 415 push @{ $macro->{action} }, $_[0];
280 $textedit->set_text (macro_to_text $macro); 416 $textedit->set_text (macro_to_text $macro);
281 }) if $::CONN; 417 }) if $::CONN;
282 } else { 418 } else {
283 $widget->set_text ("Start Recording"); 419 $widget->set_text ("Start Recording");
284 $::CONN->record if $::CONN; 420 $::CONN->record if $::CONN;
285 } 421 }
286 }, 422 },
287 ); 423 );
288 }; 424 };
289 425
426 $macros->add (new DC::UI::Button
427 text => "New Macro",
428 tooltip => "Creates a new, empty, macro you can edit.",
429 on_activate => sub {
430 my $macro = { };
431 push @{ $::PROFILE->{macro} }, $macro;
432 $edit_macro->($macro);
433 },
434 );
435
436 $macros->add (my $macrolist = new DC::UI::Table col_expand => [0, 1]);
437
290 $REFRESH_MACRO_LIST = $refresh = sub { 438 $REFRESH_MACRO_LIST = $refresh = sub {
291 $macros->clear; 439 $macrolist->clear;
292 440
293 $macros->add (0, 0, new CFPlus::UI::Label 441 $macrolist->add_at (0, 1, new DC::UI::Label
294 text => "Trigger", 442 text => "Trigger",
443 tooltip => $tooltip_trigger . $tooltip_common,
444 );
445 $macrolist->add_at (1, 1, new DC::UI::Label
446 text => "Actions",
295 align => 0, 447 align => 0,
296 tooltip => $tooltip_trigger . $tooltip_common,
297 );
298 $macros->add (1, 0, new CFPlus::UI::Label
299 text => "Commands",
300 tooltip => $tooltip_commands . $tooltip_common, 448 tooltip => $tooltip_commands . $tooltip_common,
301 ); 449 );
302 450
303 for my $idx (0 .. $#{$::PROFILE->{macro} || []}) { 451 for my $idx (0 .. $#{$::PROFILE->{macro} || []}) {
304 my $macro = $::PROFILE->{macro}[$idx]; 452 my $macro = $::PROFILE->{macro}[$idx];
305 my $y = $idx + 1; 453 my $y = $idx + 2;
306 454
307 my $macro_cb = sub { 455 my $macro_cb = sub {
308 my ($widget, $ev) = @_; 456 my ($widget, $ev) = @_;
309 457
310 if ($ev->{button} == 1) { 458 if ($ev->{button} == 1) {
311 $edit_macro->($macro), 459 $edit_macro->($macro),
312 } elsif ($ev->{button} == 2) { 460 } elsif ($ev->{button} == 2) {
313 $::CONN->macro_send ($macro) if $::CONN; 461 execute ($macro);
314 } elsif ($ev->{button} == 3) { 462 } elsif ($ev->{button} == 3) {
315 (new CFPlus::UI::Menu 463 (new DC::UI::Menu
316 items => [ 464 items => [
317 ["Edit" => sub { $edit_macro->($macro) }], 465 ["Edit" => sub { $edit_macro->($macro) }],
318 ["Invoke" => sub { $::CONN->macro_send ($macro) if $::CONN }], 466 ["Invoke" => sub { execute ($macro) }],
319 ["Delete" => sub { 467 ["Delete" => sub {
320 # might want to use grep instead 468 # might want to use grep instead
321 splice @{$::PROFILE->{macro}}, $idx, 1, (); 469 splice @{$::PROFILE->{macro}}, $idx, 1, ();
322 $refresh->(); 470 $refresh->();
323 }], 471 }],
328 } 476 }
329 477
330 1 478 1
331 }; 479 };
332 480
333 $macros->add (0, $y, new CFPlus::UI::Label 481 $macrolist->add_at (0, $y, new DC::UI::Label
334 text => trigger_to_string $macro, 482 text => trigger_to_string $macro,
335 tooltip => $tooltip_trigger . $tooltip_common, 483 tooltip => $tooltip_trigger . $tooltip_common,
336 align => 0, 484 fg => [1, 0.8, 0.8],
337 can_hover => 1, 485 can_hover => 1,
338 can_events => 1, 486 can_events => 1,
339 on_button_down => $macro_cb, 487 on_button_down => $macro_cb,
340 ); 488 );
341 489
342 $macros->add (1, $y, new CFPlus::UI::Label 490 $macrolist->add_at (1, $y, new DC::UI::Label
343 text => (join "; ", @{ $macro->{action} || [] }), 491 text => (join "; ", @{ $macro->{action} || [] }),
344 tooltip => $tooltip_commands . $tooltip_common, 492 tooltip => $tooltip_commands . $tooltip_common,
493 fg => [0.9, 0.9, 0.9],
494 align => 0,
345 expand => 1, 495 expand => 1,
346 ellipsise => 3, 496 ellipsise => 3,
347 can_hover => 1, 497 can_hover => 1,
348 can_events => 1, 498 can_events => 1,
349 on_button_down => $macro_cb, 499 on_button_down => $macro_cb,
373 523
374 &$end_cb if $end_cb; 524 &$end_cb if $end_cb;
375 }; 525 };
376} 526}
377 527
5281

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines