From b94c9fd1cd3731c9a0bdcabcb15e7bead85021dc Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Wed, 17 Jul 2013 22:26:11 -0700 Subject: Add fullscreen support and add a keybinding for exiting the emulator --- io.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index fa9e2b2..b277c3c 100644 --- a/io.c +++ b/io.c @@ -12,7 +12,8 @@ enum { typedef enum { UI_DEBUG_MODE_INC, UI_DEBUG_PAL_INC, - UI_ENTER_DEBUGGER + UI_ENTER_DEBUGGER, + UI_EXIT } ui_action; typedef struct { @@ -209,6 +210,8 @@ void handle_binding_up(keybinding * binding) case UI_ENTER_DEBUGGER: break_on_sync = 1; break; + case UI_EXIT: + exit(0); } break; } @@ -280,6 +283,8 @@ int parse_binding_target(char * target, tern_node * padbuttons, int * ui_out, in *ui_out = UI_DEBUG_PAL_INC; } else if(!strcmp(target + 3, "enter_debugger")) { *ui_out = UI_ENTER_DEBUGGER; + } else if(!strcmp(target + 3, "exit")) { + *ui_out = UI_EXIT; } else { fprintf(stderr, "Unreconized UI binding type %s\n", target); return 0; @@ -339,6 +344,7 @@ void set_keybindings() special = tern_insert_int(special, "left", RENDERKEY_LEFT); special = tern_insert_int(special, "right", RENDERKEY_RIGHT); special = tern_insert_int(special, "enter", '\r'); + special = tern_insert_int(special, "esc", RENDERKEY_ESC); tern_node * padbuttons = tern_insert_int(NULL, ".up", DPAD_UP); padbuttons = tern_insert_int(padbuttons, ".down", DPAD_DOWN); -- cgit v1.2.3