RetroArch
Classes | Macros | Functions | Variables
keyboard.c File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/iosupport.h>
#include <stdio.h>
#include <malloc.h>
#include <ctype.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <gccore.h>
#include <ogc/usb.h>
#include <ogc/lwp_queue.h>
#include <wiikeyboard/usbkeyboard.h>
#include <wiikeyboard/keyboard.h>
#include "wsksymvar.h"
Include dependency graph for keyboard.c:

Classes

struct  nameint
 
struct  _keyheld
 
struct  _node
 

Macros

#define KBD_THREAD_STACKSIZE   (1024 * 4)
 
#define KBD_THREAD_PRIO   64
 
#define KBD_THREAD_UDELAY   (1000 * 10)
 
#define KBD_THREAD_KBD_SCAN_INTERVAL   (3 * 100)
 
#define MAXHELD   8
 

Functions

keysym_t ksym_upcase (keysym_t)
 
static u8 *_kbd_stack [KBD_THREAD_STACKSIZEATTRIBUTE_ALIGN (8)
 
static kbd_t _get_keymap_by_name (const char *identifier)
 
static s32 _kbd_addEvent (const keyboard_event *event)
 
void update_modifier (u_int type, int toggle, int mask)
 
static void _kbd_event_cb (USBKeyboard_event kevent)
 
static s32 _kbd_scan_for_keyboard (void)
 
static void_kbd_thread_func (void *arg)
 
static void_kbd_buf_thread_func (void *arg)
 
static ssize_t _keyboardRead (struct _reent *r, void *unused, char *ptr, size_t len)
 
s32 KEYBOARD_Init (keyPressCallback keypress_cb)
 
s32 KEYBOARD_Deinit (void)
 
s32 KEYBOARD_GetEvent (keyboard_event *event)
 
s32 KEYBOARD_FlushEvents (void)
 

Variables

static lwp_queue _queue
 
static lwp_t _kbd_thread = LWP_THREAD_NULL
 
static lwp_t _kbd_buf_thread = LWP_THREAD_NULL
 
static bool _kbd_thread_running = false
 
static bool _kbd_thread_quit = false
 
const struct wscons_keydesc ukbd_keydesctab []
 
static struct wskbd_mapdata _ukbd_keymapdata
 
static struct nameint kbdenc_tab []
 
static struct nameint kbdvar_tab []
 
static int _sc_maplen = 0
 
static struct wscons_keymap_sc_map = 0
 
static u16 _modifiers
 
static int _composelen
 
static keysym_t _composebuf [2]
 
static _keyheld _held [MAXHELD]
 
static keyPressCallback _readKey_cb = NULL
 
struct {
   vu8   head
 
   vu8   tail
 
   char   buf [256]
 
_keyBuffer
 
static const devoptab_t std_in
 

Macro Definition Documentation

◆ KBD_THREAD_KBD_SCAN_INTERVAL

#define KBD_THREAD_KBD_SCAN_INTERVAL   (3 * 100)

◆ KBD_THREAD_PRIO

#define KBD_THREAD_PRIO   64

◆ KBD_THREAD_STACKSIZE

#define KBD_THREAD_STACKSIZE   (1024 * 4)

◆ KBD_THREAD_UDELAY

#define KBD_THREAD_UDELAY   (1000 * 10)

◆ MAXHELD

#define MAXHELD   8

Function Documentation

◆ _get_keymap_by_name()

static kbd_t _get_keymap_by_name ( const char *  identifier)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _kbd_addEvent()

static s32 _kbd_addEvent ( const keyboard_event event)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _kbd_buf_thread_func()

static void* _kbd_buf_thread_func ( void arg)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _kbd_event_cb()

static void _kbd_event_cb ( USBKeyboard_event  kevent)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _kbd_scan_for_keyboard()

static s32 _kbd_scan_for_keyboard ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _kbd_thread_func()

static void* _kbd_thread_func ( void arg)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _keyboardRead()

static ssize_t _keyboardRead ( struct _reent *  r,
void unused,
char *  ptr,
size_t  len 
)
static

◆ ATTRIBUTE_ALIGN()

static u8* _kbd_stack [KBD_THREAD_STACKSIZE] ATTRIBUTE_ALIGN ( )
static

◆ KEYBOARD_Deinit()

s32 KEYBOARD_Deinit ( void  )
Here is the call graph for this function:

◆ KEYBOARD_FlushEvents()

s32 KEYBOARD_FlushEvents ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ KEYBOARD_GetEvent()

s32 KEYBOARD_GetEvent ( keyboard_event event)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ KEYBOARD_Init()

s32 KEYBOARD_Init ( keyPressCallback  keypress_cb)
Here is the call graph for this function:

◆ ksym_upcase()

keysym_t ksym_upcase ( keysym_t  ksym)
Here is the caller graph for this function:

◆ update_modifier()

void update_modifier ( u_int  type,
int  toggle,
int  mask 
)
Here is the caller graph for this function:

Variable Documentation

◆ _composebuf

keysym_t _composebuf[2]
static

◆ _composelen

int _composelen
static

◆ _held

_keyheld _held[MAXHELD]
static

◆ _kbd_buf_thread

lwp_t _kbd_buf_thread = LWP_THREAD_NULL
static

◆ _kbd_thread

lwp_t _kbd_thread = LWP_THREAD_NULL
static

◆ _kbd_thread_quit

bool _kbd_thread_quit = false
static

◆ _kbd_thread_running

bool _kbd_thread_running = false
static

◆ _keyBuffer

struct { ... } _keyBuffer

◆ _modifiers

u16 _modifiers
static

◆ _queue

lwp_queue _queue
static

◆ _readKey_cb

keyPressCallback _readKey_cb = NULL
static

◆ _sc_map

struct wscons_keymap* _sc_map = 0
static

◆ _sc_maplen

int _sc_maplen = 0
static

◆ _ukbd_keymapdata

struct wskbd_mapdata _ukbd_keymapdata
static
Initial value:
= {
}
#define KB_NONE
Definition: wsksymdef.h:697
const struct wscons_keydesc ukbd_keydesctab[]
Definition: ukbdmap.c:1075

◆ buf

char buf[256]

◆ head

vu8 head

◆ kbdenc_tab

struct nameint kbdenc_tab[]
static
Initial value:
= {
}
#define KB_ENCTAB
Definition: wsksymdef.h:736

◆ kbdvar_tab

struct nameint kbdvar_tab[]
static
Initial value:
= {
}
#define KB_VARTAB
Definition: wsksymdef.h:765

◆ std_in

const devoptab_t std_in
static
Initial value:
=
{
"stdin",
0,
}
static ssize_t _keyboardRead(struct _reent *r, void *unused, char *ptr, size_t len)
Definition: keyboard.c:447
#define NULL
Pointer to 0.
Definition: gctypes.h:65

◆ tail

vu8 tail

◆ ukbd_keydesctab

const struct wscons_keydesc ukbd_keydesctab[]