summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-07-17 22:26:11 -0700
committerMike Pavone <pavone@retrodev.com>2013-07-17 22:26:11 -0700
commitb94c9fd1cd3731c9a0bdcabcb15e7bead85021dc (patch)
treec8728e73773862cf1314e59b540f84369af8c681 /io.c
parent1482ef3c532eca86baf1d81a02822ff0962cedf8 (diff)
Add fullscreen support and add a keybinding for exiting the emulator
Diffstat (limited to 'io.c')
-rw-r--r--io.c8
1 files changed, 7 insertions, 1 deletions
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);