PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
libkbd.c File Reference
#include <tamtypes.h>
#include <fcntl.h>
#include <unistd.h>
#include <ps2sdkapi.h>
#include "libkbd.h"
+ Include dependency graph for libkbd.c:

Go to the source code of this file.

Functions

int PS2KbdInit (void)
 
int PS2KbdRead (char *key)
 
int PS2KbdReadRaw (PS2KbdRawKey *key)
 
int PS2KbdSetReadmode (u32 readmode)
 
int PS2KbdSetBlockingMode (u32 blockmode)
 
int PS2KbdSetRepeatRate (u32 repeat)
 
int PS2KbdSetLeds (u8 leds)
 
int PS2KbdSetKeymap (PS2KbdKeyMap *keymaps)
 
int PS2KbdSetCtrlmap (u8 *ctrlmap)
 
int PS2KbdSetAltmap (u8 *altmap)
 
int PS2KbdSetSpecialmap (u8 *special)
 
int PS2KbdFlushBuffer (void)
 
int PS2KbdResetKeymap (void)
 
int PS2KbdClose (void)
 

Variables

int _iop_reboot_count
 
static int kbd_iop = -1
 
static int kbd_fd = -1
 
static int curr_blockmode = PS2KBD_NONBLOCKING
 
static int curr_readmode = PS2KBD_READMODE_NORMAL
 

Detailed Description

USB Keyboard Driver for PS2

Definition in file libkbd.c.

Function Documentation

◆ PS2KbdInit()

int PS2KbdInit ( void  )

Initialise the keyboard library

Definition at line 28 of file libkbd.c.

◆ PS2KbdRead()

int PS2KbdRead ( char *  key)

Reads 1 character from the keyboard

Definition at line 50 of file libkbd.c.

◆ PS2KbdReadRaw()

int PS2KbdReadRaw ( PS2KbdRawKey key)

Reads 1 raw character from the keyboard

Definition at line 60 of file libkbd.c.

◆ PS2KbdSetReadmode()

int PS2KbdSetReadmode ( u32  readMode)

Sets the read mode to normal or raw

Definition at line 70 of file libkbd.c.

References PS2KBD_IOCTL_SETREADMODE.

◆ PS2KbdSetBlockingMode()

int PS2KbdSetBlockingMode ( u32  readMode)

Sets the blocking mode on or off

Definition at line 80 of file libkbd.c.

References PS2KBD_IOCTL_SETBLOCKMODE.

◆ PS2KbdSetRepeatRate()

int PS2KbdSetRepeatRate ( u32  repeat)

Sets the repeat rate in millseconds

Definition at line 90 of file libkbd.c.

References PS2KBD_IOCTL_SETREPEATRATE.

◆ PS2KbdSetLeds()

int PS2KbdSetLeds ( u8  leds)

Sets all connected keyboards leds

Definition at line 99 of file libkbd.c.

References PS2KBD_IOCTL_SETLEDS.

◆ PS2KbdSetKeymap()

int PS2KbdSetKeymap ( PS2KbdKeyMap keymaps)

Sets the current keymap

Definition at line 108 of file libkbd.c.

References PS2KBD_IOCTL_SETKEYMAP.

◆ PS2KbdSetCtrlmap()

int PS2KbdSetCtrlmap ( u8 *  ctrlmap)

Sets the control key mappings

Definition at line 117 of file libkbd.c.

References PS2KBD_IOCTL_SETCTRLMAP.

◆ PS2KbdSetAltmap()

int PS2KbdSetAltmap ( u8 *  altmap)

Sets the alt key mappings

Definition at line 126 of file libkbd.c.

References PS2KBD_IOCTL_SETALTMAP.

◆ PS2KbdSetSpecialmap()

int PS2KbdSetSpecialmap ( u8 *  special)

Sets the special key mappings

Definition at line 135 of file libkbd.c.

References PS2KBD_IOCTL_SETSPECIALMAP.

◆ PS2KbdFlushBuffer()

int PS2KbdFlushBuffer ( void  )

Flushes the keyboard buffer

Definition at line 144 of file libkbd.c.

References PS2KBD_IOCTL_FLUSHBUFFER.

◆ PS2KbdResetKeymap()

int PS2KbdResetKeymap ( void  )

Resets the keymap to the default US mapping

Definition at line 155 of file libkbd.c.

References PS2KBD_IOCTL_RESETKEYMAP.

◆ PS2KbdClose()

int PS2KbdClose ( void  )

Close down the keyboard library

Definition at line 166 of file libkbd.c.

Variable Documentation

◆ kbd_iop

int kbd_iop = -1
static

Definition at line 23 of file libkbd.c.

◆ kbd_fd

int kbd_fd = -1
static

Definition at line 24 of file libkbd.c.

◆ curr_blockmode

int curr_blockmode = PS2KBD_NONBLOCKING
static

Definition at line 25 of file libkbd.c.

◆ curr_readmode

int curr_readmode = PS2KBD_READMODE_NORMAL
static

Definition at line 26 of file libkbd.c.