require 'clibs'
local Keys = {}
local WINDOWS = (NylonOs and NylonOs.IsWindows())
Keys.control = {
menu = 429, editTitle = 436, }
Keys.edit = {
[18] = 'isearch_backward', [19] = 'isearch_forward',
[1] = 'move_beginning_of_line', [5] = 'move_end_of_line',
[6] = 'forward_char', [2] = 'backward_char', [Pdcurses.key.right] = 'forward_char', [Pdcurses.key.left] = 'backward_char',
[7] = 'ctrlg',
[422] = 'forward_word', [418] = 'backward_word', [437] = 'upcase_word', [428] = 'downcase_word', [419] = 'capitalize_word',
[22] = 'scroll_up_command', [Pdcurses.key.npage] = 'scroll_up_command', [438] = 'scroll_down_command', [Pdcurses.key.ppage] = 'scroll_down_command',
[Pdcurses.key.dc] = 'delete_char', [4] = 'delete_char', [8] = 'delete_backward_char',
[263] = 'delete_backward_char',
[420] = 'delete_word', [11] = 'kill_line', [441] = 'yank_pop', [26] = 'undo',
[445] = 'scroll_right', [446] = 'scroll_left',
[9] = 'indent_for_tab_command', [10] = 'newline', [25] = 'yank', [27] = 'escape'
}
Keys.everybody = {
[Pdcurses.key.down] = 'next_line',
[Pdcurses.key.up] = 'previous_line',
[22] = 'scroll_up_command', [Pdcurses.key.npage] = 'scroll_up_command', [438] = 'scroll_down_command', [Pdcurses.key.ppage] = 'scroll_down_command',
[14] = 'next_line', [15] = 'context_menu', [16] = 'previous_line', [23] = 'kill_region', [431] = 'toggle_landscape', [439] = 'kill_ring_save', }
if WINDOWS then
local keymap_everybody_windows = {
[Pdcurses.key.ctl_tab] = 'other_window',
[Pdcurses.key.ctl_enter] = 'focused_window_to_primary', [Pdcurses.key.ctl_home] = 'beginning_of_buffer', [Pdcurses.key.ctl_end] = 'end_of_buffer', [Pdcurses.key.sdown] = 'xyz', [Pdcurses.key.sup] = 'xyz', [13] = 10,
}
for i,v in pairs(keymap_everybody_windows) do
Keys.everybody[i] = v
end
end
Keys.command_prefix = {
[3] = 'save_buffers_kill_terminal', [19] = 'save_buffer', [string.byte('k',1)] = 'kill_buffer', [string.byte('u',1)] = 'undo', [string.byte('o',1)] = 'other_window', [string.byte('i',1)] = 'insert_file', [string.byte('m',1)] = 'mail_record', [string.byte(' ',1)] = 'set_mark_command', }
Keys.personal_prefix = {
[string.byte('.',1)] = 'jumptotag', [3] = 'query_citations', [string.byte('>',1)] = 'extract_to_new_record',
[string.byte('n',1)] = 'insert_ref_to_new_record',
[string.byte('y',1)] = 'special_yank',
}
Keys.esc_prefix = { [string.byte('a',1)] = 417,
[string.byte('b',1)] = 418,
[string.byte('c',1)] = 419,
[string.byte('d',1)] = 420,
[string.byte('e',1)] = 421,
[string.byte('f',1)] = 422,
[string.byte('g',1)] = 423,
[string.byte('l',1)] = 428,
[string.byte('o',1)] = 431,
[string.byte('s',1)] = 435,
[string.byte('t',1)] = 436,
[string.byte('u',1)] = 437,
[string.byte('w',1)] = 439,
[string.byte('y',1)] = 441,
}
return Keys