26 #include "../../events/SDL_sysevents.h"
27 #include "../../events/SDL_events_c.h"
28 #include "../../events/SDL_keyboard_c.h"
31 #include "SDL_thread.h"
36 #include <pspirkeyb.h>
37 #include <pspirkeyb_rawkeys.h>
39 #define IRKBD_CONFIG_FILE NULL
41 static int irkbd_ready = 0;
42 static SDLKey keymap[256];
45 static enum PspHprmKeys
hprm = 0;
65 sceHprmPeekCurrentKey(&
hprm);
68 sceKernelDelayThread(1000000 / 60);
76 enum PspHprmKeys keys;
77 enum PspHprmKeys changed;
78 static enum PspHprmKeys old_keys = 0;
86 changed = old_keys ^ keys;
107 unsigned char buffer[255];
109 SIrKeybScanCodeData *scanData;
111 if(pspIrKeybReadinput(buffer, &length) >= 0) {
112 if((length %
sizeof(SIrKeybScanCodeData)) == 0){
113 count = length /
sizeof(SIrKeybScanCodeData);
114 for( i=0; i <
count; i++ ) {
115 unsigned char raw, pressed;
116 scanData=(SIrKeybScanCodeData*) buffer+i;
118 pressed = scanData->pressed;
120 sym.
sym = keymap[raw];
131 sceKernelDelayThread(0);
157 keymap[KEY_F13] = SDLK_PRINT;
227 keymap[KEY_NUMLOCK] = SDLK_NUMLOCK;
228 keymap[KEY_LEFTMETA] = SDLK_LSUPER;
249 int outputmode = PSP_IRKBD_OUTPUT_MODE_SCANCODE;
250 int ret = pspIrKeybInit(IRKBD_CONFIG_FILE, 0);
251 if (ret == PSP_IRKBD_RESULT_OK) {
252 pspIrKeybOutputMode(outputmode);
DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value)
int EventUpdate(void *data)
struct SDL_semaphore SDL_sem
DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem)
static SDL_sem * event_sem
static SDL_Thread * thread
The SDL keysym structure, used in key events.
void PSP_EventQuit(_THIS)
Sint32 SDL_Keycode
The SDL virtual key representation.
int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status)
EGLContext EGLenum EGLClientBuffer buffer
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key)
Get the scancode corresponding to the given key code according to the current keyboard layout...
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
static struct @85 keymap_psp[]
void PSP_EventInit(_THIS)
DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem)
DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data)
#define SDL_TABLESIZE(table)
void PSP_PumpEvents(_THIS)
void PSP_InitOSKeymap(_THIS)
DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem)
static enum PspHprmKeys hprm