wavelength 1.0.0
Loading...
Searching...
No Matches
keyboard.h File Reference
#include "app/msgsink.h"
Include dependency graph for keyboard.h:

Go to the source code of this file.

Enumerations

enum  KeyboardKeyCode {
  kKeyNone = 0 , kKeyCapsLock = 0x122 , kKeyNumLock = 0x123 , kKeyScrollLock = 0x124 ,
  kKeyPrintScreen = 0x12c , kKeyPause = 0x12d , kKeyEscape = 0x12e , kKeyInsert = 0x136 ,
  kKeyDelete = 0x137 , kKeyHome = 0x138 , kKeyEnd = 0x139 , kKeyPageUp = 0x13a ,
  kKeyPageDown = 0x13b , kKeyLeft = 0x140 , kKeyRight = 0x141 , kKeyUp = 0x142 ,
  kKeyDown = 0x143 , kKeyF1 = 0x191
}
 Keys KeyboardKeyMsg reports for keys without a character. More...

Functions

void KeyboardInit ()
 Start the USB keyboard library and set up keyboard 0.
void KeyboardTerminate ()
 Stop the USB keyboard library.
void KeyboardPoll ()
 Advance the keyboard's request cycle and send a KeyboardKeyMsg for a key pressed.
void KeyboardAddSink (MsgSink *pSink)
 Add a sink to the receivers of the USB keyboard messages.
void KeyboardRemoveSink (MsgSink *pSink)
 Remove a sink from the receivers of the USB keyboard messages.

Enumeration Type Documentation

◆ KeyboardKeyCode

Keys KeyboardKeyMsg reports for keys without a character.

Enumerator
kKeyNone 

No key.

kKeyCapsLock 

Caps Lock.

kKeyNumLock 

Num Lock.

kKeyScrollLock 

Scroll Lock.

kKeyPrintScreen 

Print Screen.

kKeyPause 

Pause.

kKeyEscape 

Escape.

kKeyInsert 

Insert.

kKeyDelete 

Delete.

kKeyHome 

Home.

kKeyEnd 

End.

kKeyPageUp 

Page Up.

kKeyPageDown 

Page Down.

kKeyLeft 

The left arrow.

kKeyRight 

The right arrow.

kKeyUp 

The up arrow.

kKeyDown 

The down arrow.

kKeyF1 

F1, the first of the twelve function keys.

Function Documentation

◆ KeyboardInit()

void KeyboardInit ( )

Start the USB keyboard library and set up keyboard 0.

Ghidra address:
NTSC-U/C: 0x0028b148
Ghidra address:
PAL: 0x00294940

◆ KeyboardTerminate()

void KeyboardTerminate ( )

Stop the USB keyboard library.

Ghidra address:
NTSC-U/C: 0x0028b1c8
Ghidra address:
PAL: 0x002949c0

◆ KeyboardPoll()

void KeyboardPoll ( )

Advance the keyboard's request cycle and send a KeyboardKeyMsg for a key pressed.

Without a keyboard, the poll checks for one every hundred calls. With one, each call that finds the previous request finished starts the next read.

Ghidra address:
NTSC-U/C: 0x0028b1f0
Ghidra address:
PAL: 0x002949e8

◆ KeyboardAddSink()

void KeyboardAddSink ( MsgSink * pSink)

Add a sink to the receivers of the USB keyboard messages.

The name is inferred from JoypadAddSink(), which it mirrors.

Parameters
pSinkThe sink.
Ghidra address:
NTSC-U/C: 0x0028b2c8
Ghidra address:
PAL: 0x00294ac0

◆ KeyboardRemoveSink()

void KeyboardRemoveSink ( MsgSink * pSink)

Remove a sink from the receivers of the USB keyboard messages.

Parameters
pSinkThe sink.
Ghidra address:
NTSC-U/C: 0x0028b2f0
Ghidra address:
PAL: 0x00294ae8