… | |
… | |
337 | ::toggle_player_page ($::SPELL_PAGE); |
337 | ::toggle_player_page ($::SPELL_PAGE); |
338 | } elsif ($sym == CFPlus::SDLK_F5 && !$mod) { |
338 | } elsif ($sym == CFPlus::SDLK_F5 && !$mod) { |
339 | ::toggle_player_page ($::INVENTORY_PAGE); |
339 | ::toggle_player_page ($::INVENTORY_PAGE); |
340 | } elsif ($sym == CFPlus::SDLK_F9 && !$mod) { |
340 | } elsif ($sym == CFPlus::SDLK_F9 && !$mod) { |
341 | $::SETUP_DIALOG->toggle_visibility; |
341 | $::SETUP_DIALOG->toggle_visibility; |
342 | } elsif ($sym == CFPlus::SDLK_INSERT && $mod & CFPlus::KMOD_CTRL) { |
|
|
343 | $::BIND_EDITOR->set_binding (undef, undef, [], |
|
|
344 | sub { |
|
|
345 | my ($mod, $sym, $cmds) = @_; |
|
|
346 | $::BIND_EDITOR->cfg_bind ($mod, $sym, $cmds); |
|
|
347 | }); |
|
|
348 | $::BIND_EDITOR->start; |
|
|
349 | $::BIND_EDITOR->show; |
|
|
350 | #TODO: elmex, what was this supposed to do? it currently crashes the client. |
|
|
351 | # } elsif ($sym == CFPlus::SDLK_INSERT && not ($mod & CFPlus::KMOD_CTRL)) { |
|
|
352 | # $::BIND_EDITOR->stop; |
|
|
353 | # $::BIND_EDITOR->ask_for_bind_and_commit; |
|
|
354 | # $::BIND_EDITOR->hide; |
|
|
355 | } elsif (!$::CONN) { |
342 | } elsif (!$::CONN) { |
356 | return 0; # bindings further down need a valid connection |
343 | return 0; # bindings further down need a valid connection |
357 | |
344 | |
358 | } elsif ($sym == CFPlus::SDLK_KP5 && !$mod) { |
345 | } elsif ($sym == CFPlus::SDLK_KP5 && !$mod) { |
359 | $::CONN->user_send ("stay fire"); |
346 | $::CONN->user_send ("stay fire"); |
… | |
… | |
364 | } elsif ($uni == 13) { |
351 | } elsif ($uni == 13) { |
365 | $::CONN->user_send ("examine"); |
352 | $::CONN->user_send ("examine"); |
366 | } elsif ($uni == ord ".") { |
353 | } elsif ($uni == ord ".") { |
367 | $::CONN->user_send ($self->{completer}{last_command}) |
354 | $::CONN->user_send ($self->{completer}{last_command}) |
368 | if exists $self->{completer}{last_command}; |
355 | if exists $self->{completer}{last_command}; |
369 | } elsif (my $bind_cmd = $::PROFILE->{bindings}{$mod}{$sym}) { |
356 | } elsif (my @macros = CFPlus::Macro::match_event $ev) { |
|
|
357 | warn "<@macros>\n";#d# |
370 | $::CONN->user_send ($_) for @$bind_cmd; |
358 | $::CONN->macro_send ($_) for @macros; |
371 | } elsif (($sym == CFPlus::SDLK_KP_PLUS && !$mod) || $uni == ord "+") { |
359 | } elsif (($sym == CFPlus::SDLK_KP_PLUS && !$mod) || $uni == ord "+") { |
372 | $::CONN->user_send ("rotateshoottype +"); |
360 | $::CONN->user_send ("rotateshoottype +"); |
373 | } elsif (($sym == CFPlus::SDLK_KP_MINUS && !$mod) || $uni == ord "-") { |
361 | } elsif (($sym == CFPlus::SDLK_KP_MINUS && !$mod) || $uni == ord "-") { |
374 | $::CONN->user_send ("rotateshoottype -"); |
362 | $::CONN->user_send ("rotateshoottype -"); |
375 | } elsif ($uni == ord '"') { |
363 | } elsif ($uni == ord '"') { |