PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ps2kbd.h File Reference
#include <tamtypes.h>
+ Include dependency graph for ps2kbd.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _kbd_rawkey
 
struct  _kbd_keymap
 

Macros

#define PS2KBD_FSNAME   "usbkbd"
 
#define PS2KBD_KBDFILE   "dev"
 
#define PS2KBD_DEVFILE   (PS2KBD_FSNAME ":" PS2KBD_KBDFILE)
 
#define PS2KBD_LED_NUMLOCK   1
 
#define PS2KBD_LED_CAPSLOCK   2
 
#define PS2KBD_LED_SCRLOCK   4
 
#define PS2KBD_LED_COMPOSE   8
 
#define PS2KBD_LED_KANA   16
 
#define PS2KBD_LED_MASK   0x1F;
 
#define PS2KBD_ESCAPE_KEY   0x1B
 
#define PS2KBD_LEFT_CTRL   (1 << 0)
 
#define PS2KBD_LEFT_SHIFT   (1 << 1)
 
#define PS2KBD_LEFT_ALT   (1 << 2)
 
#define PS2KBD_LEFT_GUI   (1 << 3)
 
#define PS2KBD_RIGHT_CTRL   (1 << 4)
 
#define PS2KBD_RIGHT_SHIFT   (1 << 5)
 
#define PS2KBD_RIGHT_ALT   (1 << 6)
 
#define PS2KBD_RIGHT_GUI   (1 << 7)
 
#define PS2KBD_CTRL   (PS2KBD_LEFT_CTRL | PS2KBD_RIGHT_CTRL)
 
#define PS2KBD_SHIFT   (PS2KBD_LEFT_SHIFT | PS2KBD_RIGHT_SHIFT)
 
#define PS2KBD_ALT   (PS2KBD_LEFT_ALT | PS2KBD_RIGHT_ALT)
 
#define PS2KBD_GUI   (PS2KBD_LEFT_GUI | PS2KBD_RIGHT_GUI)
 
#define PS2KBD_RAWKEY_UP   0xF0
 
#define PS2KBD_RAWKEY_DOWN   0xF1
 
#define PS2KBD_READMODE_NORMAL   1
 
#define PS2KBD_READMODE_RAW   2
 
#define PS2KBD_BLOCKING   1
 
#define PS2KBD_NONBLOCKING   0
 
#define PS2KBD_KEYMAP_SIZE   256
 
#define PS2KBD_IOCTL_SETREADMODE   1
 
#define PS2KBD_IOCTL_SETLEDS   2
 
#define PS2KBD_IOCTL_SETREPEATRATE   3
 
#define PS2KBD_IOCTL_SETKEYMAP   4
 
#define PS2KBD_IOCTL_SETCTRLMAP   5
 
#define PS2KBD_IOCTL_SETALTMAP   6
 
#define PS2KBD_IOCTL_SETSPECIALMAP   7
 
#define PS2KBD_IOCTL_SETBLOCKMODE   8
 
#define PS2KBD_IOCTL_FLUSHBUFFER   9
 
#define PS2KBD_IOCTL_RESETKEYMAP   10
 

Typedefs

typedef struct _kbd_rawkey kbd_rawkey
 
typedef struct _kbd_keymap kbd_keymap
 

Detailed Description

USB Keyboard Driver for PS2

Definition in file ps2kbd.h.


Data Structure Documentation

◆ _kbd_rawkey

struct _kbd_rawkey

Definition at line 52 of file ps2kbd.h.

Data Fields
u8 state
u8 key

◆ _kbd_keymap

struct _kbd_keymap

Definition at line 73 of file ps2kbd.h.

Data Fields
u8 keymap[PS2KBD_KEYMAP_SIZE]
u8 shiftkeymap[PS2KBD_KEYMAP_SIZE]
u8 keycap[PS2KBD_KEYMAP_SIZE]

Macro Definition Documentation

◆ PS2KBD_FSNAME

#define PS2KBD_FSNAME   "usbkbd"

Definition at line 21 of file ps2kbd.h.

◆ PS2KBD_KBDFILE

#define PS2KBD_KBDFILE   "dev"

Definition at line 22 of file ps2kbd.h.

◆ PS2KBD_DEVFILE

#define PS2KBD_DEVFILE   (PS2KBD_FSNAME ":" PS2KBD_KBDFILE)

Definition at line 23 of file ps2kbd.h.

◆ PS2KBD_LED_NUMLOCK

#define PS2KBD_LED_NUMLOCK   1

Definition at line 25 of file ps2kbd.h.

◆ PS2KBD_LED_CAPSLOCK

#define PS2KBD_LED_CAPSLOCK   2

Definition at line 26 of file ps2kbd.h.

◆ PS2KBD_LED_SCRLOCK

#define PS2KBD_LED_SCRLOCK   4

Definition at line 27 of file ps2kbd.h.

◆ PS2KBD_LED_COMPOSE

#define PS2KBD_LED_COMPOSE   8

Definition at line 28 of file ps2kbd.h.

◆ PS2KBD_LED_KANA

#define PS2KBD_LED_KANA   16

Definition at line 29 of file ps2kbd.h.

◆ PS2KBD_LED_MASK

#define PS2KBD_LED_MASK   0x1F;

Definition at line 31 of file ps2kbd.h.

◆ PS2KBD_ESCAPE_KEY

#define PS2KBD_ESCAPE_KEY   0x1B

Definition at line 33 of file ps2kbd.h.

◆ PS2KBD_LEFT_CTRL

#define PS2KBD_LEFT_CTRL   (1 << 0)

Definition at line 35 of file ps2kbd.h.

◆ PS2KBD_LEFT_SHIFT

#define PS2KBD_LEFT_SHIFT   (1 << 1)

Definition at line 36 of file ps2kbd.h.

◆ PS2KBD_LEFT_ALT

#define PS2KBD_LEFT_ALT   (1 << 2)

Definition at line 37 of file ps2kbd.h.

◆ PS2KBD_LEFT_GUI

#define PS2KBD_LEFT_GUI   (1 << 3)

Definition at line 38 of file ps2kbd.h.

◆ PS2KBD_RIGHT_CTRL

#define PS2KBD_RIGHT_CTRL   (1 << 4)

Definition at line 39 of file ps2kbd.h.

◆ PS2KBD_RIGHT_SHIFT

#define PS2KBD_RIGHT_SHIFT   (1 << 5)

Definition at line 40 of file ps2kbd.h.

◆ PS2KBD_RIGHT_ALT

#define PS2KBD_RIGHT_ALT   (1 << 6)

Definition at line 41 of file ps2kbd.h.

◆ PS2KBD_RIGHT_GUI

#define PS2KBD_RIGHT_GUI   (1 << 7)

Definition at line 42 of file ps2kbd.h.

◆ PS2KBD_CTRL

#define PS2KBD_CTRL   (PS2KBD_LEFT_CTRL | PS2KBD_RIGHT_CTRL)

Definition at line 44 of file ps2kbd.h.

◆ PS2KBD_SHIFT

#define PS2KBD_SHIFT   (PS2KBD_LEFT_SHIFT | PS2KBD_RIGHT_SHIFT)

Definition at line 45 of file ps2kbd.h.

◆ PS2KBD_ALT

#define PS2KBD_ALT   (PS2KBD_LEFT_ALT | PS2KBD_RIGHT_ALT)

Definition at line 46 of file ps2kbd.h.

◆ PS2KBD_GUI

#define PS2KBD_GUI   (PS2KBD_LEFT_GUI | PS2KBD_RIGHT_GUI)

Definition at line 47 of file ps2kbd.h.

◆ PS2KBD_RAWKEY_UP

#define PS2KBD_RAWKEY_UP   0xF0

Definition at line 49 of file ps2kbd.h.

◆ PS2KBD_RAWKEY_DOWN

#define PS2KBD_RAWKEY_DOWN   0xF1

Definition at line 50 of file ps2kbd.h.

◆ PS2KBD_READMODE_NORMAL

#define PS2KBD_READMODE_NORMAL   1

Definition at line 58 of file ps2kbd.h.

◆ PS2KBD_READMODE_RAW

#define PS2KBD_READMODE_RAW   2

Definition at line 59 of file ps2kbd.h.

◆ PS2KBD_BLOCKING

#define PS2KBD_BLOCKING   1

Definition at line 68 of file ps2kbd.h.

◆ PS2KBD_NONBLOCKING

#define PS2KBD_NONBLOCKING   0

Definition at line 69 of file ps2kbd.h.

◆ PS2KBD_KEYMAP_SIZE

#define PS2KBD_KEYMAP_SIZE   256

Definition at line 71 of file ps2kbd.h.

◆ PS2KBD_IOCTL_SETREADMODE

#define PS2KBD_IOCTL_SETREADMODE   1

Sets up keymapped or raw mode

Definition at line 83 of file ps2kbd.h.

◆ PS2KBD_IOCTL_SETLEDS

#define PS2KBD_IOCTL_SETLEDS   2

Sets the LED state for ALL keyboards connected

Definition at line 85 of file ps2kbd.h.

◆ PS2KBD_IOCTL_SETREPEATRATE

#define PS2KBD_IOCTL_SETREPEATRATE   3

Sets the repeat rate of the keyboard

Definition at line 87 of file ps2kbd.h.

◆ PS2KBD_IOCTL_SETKEYMAP

#define PS2KBD_IOCTL_SETKEYMAP   4

Sets the keymap for the standard keys, non shifted and shifted

Definition at line 89 of file ps2kbd.h.

◆ PS2KBD_IOCTL_SETCTRLMAP

#define PS2KBD_IOCTL_SETCTRLMAP   5

Sets the control key mapping

Definition at line 91 of file ps2kbd.h.

◆ PS2KBD_IOCTL_SETALTMAP

#define PS2KBD_IOCTL_SETALTMAP   6

Sets the alt key mapping

Definition at line 93 of file ps2kbd.h.

◆ PS2KBD_IOCTL_SETSPECIALMAP

#define PS2KBD_IOCTL_SETSPECIALMAP   7

Sets the special key mapping

Definition at line 95 of file ps2kbd.h.

◆ PS2KBD_IOCTL_SETBLOCKMODE

#define PS2KBD_IOCTL_SETBLOCKMODE   8

Sets whether the keyboard driver blocks on read

Definition at line 97 of file ps2kbd.h.

◆ PS2KBD_IOCTL_FLUSHBUFFER

#define PS2KBD_IOCTL_FLUSHBUFFER   9

Flush the internal buffer, probably best after a keymap change

Definition at line 99 of file ps2kbd.h.

◆ PS2KBD_IOCTL_RESETKEYMAP

#define PS2KBD_IOCTL_RESETKEYMAP   10

Reset keymaps to default states

Definition at line 101 of file ps2kbd.h.