WUAOFC5IXNHFPCVIY2SSQ7U5V3GUVNT5R43EDYOXYXLGZQQY2AEAC
on.keychord_press = function(chord, key)
if Animating then return end
if Move then return end
if Manifest_navigator.reload then
load_manifest()
end
if chord == 'C-=' then
-- zoom in
Viewport.zoom = Viewport.zoom+0.1
B()
elseif chord == 'C--' then
-- zoom out
if (Viewport.zoom-0.1)*20 >= 1 then -- disallow font size of 0
Viewport.zoom = Viewport.zoom-0.1
B()
end
elseif chord == 'C-0' then
-- reset zoom
Viewport.zoom = 1.0
B()
elseif chord == 'C-q' then
live.send_to_app('QUIT')
elseif Manifest_navigator.show then
keychord_press_on_manifest_navigator(chord, key)
elseif chord == 'C-n' then
new_definition()
A()
elseif chord == 'C-l' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = false
initialize_manifest_navigator()
elseif chord == 'C-d' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = true
initialize_manifest_navigator()
elseif Cursor_node then
local old_top = {line=Cursor_node.editor.screen_top1.line, pos=Cursor_node.editor.screen_top1.pos}
local old_definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
edit.keychord_press(Cursor_node.editor, chord, key)
if not eq(Cursor_node.editor.screen_top1, old_top) then
Viewport.y = Cursor_node.y + y_of_schema1(Cursor_node.editor, Cursor_node.editor.screen_top1)
end
local definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
B(--[[preserve screen_top of cursor node]] true)
else
if chord == 'up' then
Viewport.y = Viewport.y - scale(20)
B()
elseif chord == 'down' then
Viewport.y = Viewport.y + scale(20)
B()
elseif chord == 'left' then
Viewport.x = Viewport.x - scale(50)
B()
elseif chord == 'right' then
Viewport.x = Viewport.x + scale(50)
B()
elseif chord == 'pageup' then
Viewport.y = Viewport.y - App.screen.height/Viewport.zoom
B()
elseif chord == 'S-up' then
Viewport.y = Viewport.y - App.screen.height/Viewport.zoom
B()
elseif chord == 'pagedown' then
Viewport.y = Viewport.y + App.screen.height/Viewport.zoom
B()
elseif chord == 'S-down' then
Viewport.y = Viewport.y + App.screen.height/Viewport.zoom
B()
elseif chord == 'S-left' then
Viewport.x = Viewport.x - App.screen.width/Viewport.zoom
B()
elseif chord == 'S-right' then
Viewport.x = Viewport.x + App.screen.width/Viewport.zoom
B()
end
end
end
{"fw_parent":784,"manifest_navigator_up":628,"Definitions":503,"tick_spec":660,"B":379,"scale":712,"add_thick_line":400,"maybe_update_key_in_definitions":529,"copy_shape":396,"on.text_input":521,"Page":475,"reset_manifest_navigator":772,"get_definition_from_app":784,"on_handle":547,"on_text":539,"sx":544,"keychord_press_on_manifest_navigator":765,"initialize_manifest_navigator":773,"on":1,"get_multiple_definitions_from_app":783,"wait_for_response":781,"mouse_cursor":558,"box_height":680,"Mouse_cursor":559,"schema1_of_y":667,"set_mouse_cursor":562,"on.key_release":720,"draw_ticks":663,"on.load_settings":782,"line_height":365,"on.keychord_press":785,"on.save_settings":742,"update_editor_box":711,"A":713,"order_of_magnitude":573,"Ticks_font":669,"font":353,"on.code_submit":766,"on.mouse_press":722,"manifest_coord":636,"fw_app":"driver","manifest_index":637,"approximate":579,"draw_cursor":639,"manifest_navigator_candidates":638,"vy":546,"Surface":422,"Viewport":604,"manifest_navigator_down":635,"sy":469,"compute_layout":385,"delete_definition":673,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"Menu_command_color":613,"Manifest":769,"text_input_on_manifest_navigator":634,"Cursor_node":172,"load_manifest":694,"Menu_background_color":611,"get_manifest":768,"on.draw":565,"initialize_editor":678,"vx":545,"load_definition":716,"Menu_highlight_color":614,"add_def_to_menu":640,"draw_menu_bar":641,"y_of_schema1":364,"add_hotkey_to_menu":616,"load_from_iterator":670,"on.initialize":695,"draw_manifest_navigator":677,"new_definition":767,"num_lines_for_manifest_navigator":676,"on.mouse_release":721,"Menu_border_color":612,"on.update":741,"Manifest_navigator":495,"approximate_up":658,"on.code_change":734,"Animating":770}
{"draw_ticks":663,"Page":475,"table_and_array_both_empty":689,"on.initialize":695,"font":353,"order_of_magnitude":573,"approximate":579,"draw_cursor":639,"A":713,"approximate_up":658,"Animating":770,"Ticks_font":669,"scale":712,"Manifest":769,"on.code_change":734,"load_manifest":694,"initialize_editor":678,"Manifest_navigator":495,"B":379,"Menu_background_color":611,"Cursor_node":172,"Menu_border_color":612,"add_def_to_menu":640,"Menu_command_color":613,"Mouse_cursor":559,"Menu_highlight_color":614,"line_height":365,"draw_menu_bar":641,"wait_for_response":781,"add_hotkey_to_menu":616,"on_text":539,"set_mouse_cursor":562,"draw_manifest_navigator":677,"box_height":680,"num_lines_for_manifest_navigator":676,"Definitions":503,"load_definition":716,"reset_manifest_navigator":772,"get_manifest":768,"fw_parent":783,"load_from_iterator":670,"fw_app":"driver","get_definition_from_app":784,"on.code_submit":766,"on_handle":547,"move_candidate_to_front_of_manifest":632,"mouse_cursor":558,"manifest_navigator_up":628,"update_editor_box":711,"manifest_navigator_down":635,"on":1,"initialize_manifest_navigator":773,"delete_definition":673,"maybe_update_key_in_definitions":529,"copy_shape":396,"sy":469,"keychord_press_on_manifest_navigator":765,"schema1_of_y":667,"text_input_on_manifest_navigator":634,"tick_spec":660,"add_thick_line":400,"on.draw":565,"new_definition":767,"vx":545,"compute_layout":385,"Viewport":604,"on.key_release":720,"Surface":422,"vy":546,"manifest_navigator_candidates":638,"on.text_input":521,"manifest_index":637,"manifest_coord":636,"on.mouse_press":722,"get_multiple_definitions_from_app":783,"on.mouse_release":721,"y_of_schema1":364,"on.update":741,"on.save_settings":742,"on.keychord_press":774,"on.load_settings":782,"sx":544}
get_definition_from_app = function(name)
-- return definition for a name
-- if no such definition, return ''
live.send_to_app('GET '..name)
return wait_for_response()
end