Programming environment for editing various of my live apps without restarting them.
on.keychord_press = function(chord, key)
	print('key press', chord)
	if Animating then return end
	if Move then return end
	if Manifest_navigator.reload then
		load_manifest()
	end
	if chord == 'f5' then
		Show_debug = not Show_debug
	elseif chord == 'C-=' then
		-- zoom in
		Viewport.zoom = Viewport.zoom+0.1
		A()
	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
			A()
		end
	elseif chord == 'C-0' then
		-- reset zoom
		Viewport.zoom = 1.0
		A()
	elseif chord == 'C-g' then
		-- special Expose-like 'global zoom' mode
		if Zoomed_out == nil then
			zoom_out()
		else
			undo_zoom_out()
		end
	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
		animate(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 and Cursor_node.editor.cursor_x then
		if chord == 'f4' then
			submit_definition(Cursor_node.editor)
		else
			local old_top = {line=Cursor_node.editor.screen_top1.line, pos=Cursor_node.editor.screen_top1.pos}
			local old_definition_name = live.get_definition_name_from_buffer(live.definition_to_string(Cursor_node.editor))
			edit.keychord_press(Cursor_node.editor, chord, key)
			local definition_name = live.get_definition_name_from_buffer(live.definition_to_string(Cursor_node.editor))
			maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
			pan_viewport_to_contain_cursor(Cursor_node)
			if chord == 'return' then
				A1(Cursor_node.key)
				populate_collision_data()
				move_others(Cursor_node)
				A1(Cursor_node.key)
			else
				B()
			end
		end
	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