22extern int _iop_reboot_count;
23static int kbd_iop = -1;
24static int kbd_fd = -1;
25static int curr_blockmode = PS2KBD_NONBLOCKING;
26static int curr_readmode = PS2KBD_READMODE_NORMAL;
30 if (kbd_iop != _iop_reboot_count)
32 kbd_iop = _iop_reboot_count;
41 kbd_fd = open(PS2KBD_DEVFILE, O_RDONLY);
52 if((kbd_fd >= 0) && (curr_readmode == PS2KBD_READMODE_NORMAL))
54 return read(kbd_fd, key, 1);
62 if((kbd_fd >= 0) && (curr_readmode == PS2KBD_READMODE_RAW))
64 return read(kbd_fd, key, 2) / 2;
72 if((kbd_fd >= 0) && ((u32)curr_readmode != readmode))
74 curr_readmode = readmode;
82 if((kbd_fd >= 0) && ((u32)curr_blockmode != blockmode))
#define PS2KBD_IOCTL_SETREPEATRATE
#define PS2KBD_IOCTL_SETALTMAP
#define PS2KBD_IOCTL_SETLEDS
#define PS2KBD_IOCTL_SETKEYMAP
#define PS2KBD_IOCTL_SETREADMODE
#define PS2KBD_IOCTL_SETSPECIALMAP
#define PS2KBD_IOCTL_SETBLOCKMODE
#define PS2KBD_IOCTL_SETCTRLMAP
#define PS2KBD_IOCTL_FLUSHBUFFER
#define PS2KBD_IOCTL_RESETKEYMAP
int PS2KbdSetKeymap(PS2KbdKeyMap *keymaps)
int PS2KbdFlushBuffer(void)
int PS2KbdSetSpecialmap(u8 *special)
int PS2KbdSetAltmap(u8 *altmap)
int PS2KbdSetReadmode(u32 readmode)
int PS2KbdReadRaw(PS2KbdRawKey *key)
int PS2KbdSetRepeatRate(u32 repeat)
int PS2KbdSetCtrlmap(u8 *ctrlmap)
int PS2KbdSetLeds(u8 leds)
int PS2KbdResetKeymap(void)
int PS2KbdSetBlockingMode(u32 blockmode)
int PS2KbdRead(char *key)