Skip to content

Commit

Permalink
Add small test for RETRO_KEYBOARD to libretro-test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Themaister committed Aug 9, 2012
1 parent f4ecdf2 commit 92d18ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libretro-test/libretro-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>

static uint16_t *frame_buf;

Expand Down Expand Up @@ -115,6 +116,9 @@ static void update_input(void)
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT))
dir_x++;

if (input_state_cb(0, RETRO_DEVICE_KEYBOARD, 0, RETROK_RETURN))
fprintf(stderr, "Return key is pressed!\n");

dir_x += input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 2000;
dir_y += input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 2000;
//dir_x += input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 2000;
Expand Down

0 comments on commit 92d18ec

Please sign in to comment.