Kephra / lib / Kephra / App / Keymap.pm

use strict;
use warnings;
use Wx;
use Kephra::CommandList;

package Kephra::App::Keymap;

my %data;
my %compiled;

sub apply {}
sub build {}
sub copy {}

sub overlay {}

sub code_from_event {
	my $event = shift;
	die __PACKAGE__ . '::keycode_from_event got no event, but: ' . $event
		unless $event and $event->isa('Wx::Event');
	$event->GetKeyCode + 1000 * 
		( $event->ShiftDown
		+ $event->ControlDown * 2 
		+ $event->AltDown     * 4);
}


1;
__END__

shift 1000
ctrl  2000
alt   4000

   left => &Wx::WXK_LEFT,
   right => &Wx::WXK_RIGHT,
   up => &Wx::WXK_UP,
   down => &Wx::WXK_DOWN,
   pageup => &Wx::WXK_PAGEUP,
   pagedown => &Wx::WXK_PAGEDOWN,
   home => &Wx::WXK_HOME,
   end => &Wx::WXK_END,
   back => &Wx::WXK_BACK,
   tab => &Wx::WXK_TAB,
   esc => &Wx::WXK_ESCAPE,
   enter => &Wx::WXK_RETURN,
   space => &Wx::WXK_SPACE,
   del => &Wx::WXK_DELETE,
   insert => &Wx::WXK_INSERT,
   F1 => &Wx::WXK_F1,
   F2 => &Wx::WXK_F2,
   F3 => &Wx::WXK_F3,
   F4 => &Wx::WXK_F4,
   F5 => &Wx::WXK_F5,
   F6 => &Wx::WXK_F6,
   F7 => &Wx::WXK_F7,
   F8 => &Wx::WXK_F8,
   F9 => &Wx::WXK_F9,
   F10 => &Wx::WXK_F10,
   F11 => &Wx::WXK_F11,
   F12 => &Wx::WXK_F12,
   '#' => 47,
   tilde => 92,
   #WXK_NUMPAD_SPACE WXK_NUMPAD_TAB WXK_NUMPAD_ENTER WXK_NUMPAD_F1
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.