Nsyskbd.rpl: Difference between revisions
Jump to navigation
Jump to search
Rw-r-r 0644 (talk | contribs) Created page with "nsyskbd.rpl is the system library that allows applications to use the Wii U's USB keyboard. == Functions == ===Initialisation=== {| class="wikitable" !Prototype !Description..." |
Rw-r-r 0644 (talk | contribs) m Minor chanhes about unknown section of struct |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
nsyskbd.rpl is the system library that allows applications to use the | nsyskbd.rpl is the system library that allows applications to use USB keyboards plugged in the WiiU USB ports; it supports up to multiple keyboards and assign a channel to each keyboard connected. | ||
== Functions == | == Functions == | ||
Line 8: | Line 7: | ||
!Description | !Description | ||
|- | |- | ||
|<code> | |<code>uint8_t KBDSetup((void*)connection_callback,(void*)disconnection_callback,(void*)key_callback)</code> | ||
|Initializes the USB keyboard library and return 0 if | |Initializes the USB keyboard library and set callbacks; return 0 if the library was successfully initialized. connection_callback is called when an USB keyboard is connected with an uint8_t* as argument that specify the channel that was assigned to the keyboard. disconnection_callback is called when an USB keyboard is disconnected with an uint8_t* as argument that specify the channel of the keyboared that was disconnected. key_callback is called when a key event happens (press/release) and has a pointer to a key_state structure as argument | ||
|- | |||
|<code>uint8_t KBDTeardown()</code> | |||
|Deinitializes the USB keyboard library and return 0 if the deinitialization was successfull | |||
|- | |||
|<code>uint8_t KBDInit((void*)unknown,(void*)connection_callback,(void*)disconnection_callback,(void*)key_callback);</code> | |||
|Pass arguments to KBDSetup (probably an old function left for compatibility); should returns 0 if successfull | |||
|- | |||
|<code>uint8_t KBDExit();</code> | |||
|Calls KBDTeardown() (probably an old function left for compatibility); should returns 0 if successfull | |||
|- | |||
|} | |||
== Structures == | |||
{| class="wikitable" | |||
!Prototype | |||
!Description | |||
|- | |||
|<syntaxhighlight lang="C"> | |||
typedef struct { | |||
uint8_t ch; //Key channel | |||
uint8_t scancode; //Key scancode | |||
uint32_t state; //1=pressed; 0=releases; 3=keeping pressed | |||
uint32_t almost_known; //Seems something related to modifier keys (CTRL, ALT, SHIFT) | |||
uint16_t UTF16; //key value as an UTF16 char | |||
} key_state; | |||
</syntaxhighlight> | |||
|Used as argument of key_callback | |||
|- | |- | ||
|} | |} |
Latest revision as of 14:28, 4 September 2016
nsyskbd.rpl is the system library that allows applications to use USB keyboards plugged in the WiiU USB ports; it supports up to multiple keyboards and assign a channel to each keyboard connected.
Functions
Initialisation
Prototype | Description |
---|---|
uint8_t KBDSetup((void*)connection_callback,(void*)disconnection_callback,(void*)key_callback)
|
Initializes the USB keyboard library and set callbacks; return 0 if the library was successfully initialized. connection_callback is called when an USB keyboard is connected with an uint8_t* as argument that specify the channel that was assigned to the keyboard. disconnection_callback is called when an USB keyboard is disconnected with an uint8_t* as argument that specify the channel of the keyboared that was disconnected. key_callback is called when a key event happens (press/release) and has a pointer to a key_state structure as argument |
uint8_t KBDTeardown()
|
Deinitializes the USB keyboard library and return 0 if the deinitialization was successfull |
uint8_t KBDInit((void*)unknown,(void*)connection_callback,(void*)disconnection_callback,(void*)key_callback);
|
Pass arguments to KBDSetup (probably an old function left for compatibility); should returns 0 if successfull |
uint8_t KBDExit();
|
Calls KBDTeardown() (probably an old function left for compatibility); should returns 0 if successfull |
Structures
Prototype | Description |
---|---|
typedef struct {
uint8_t ch; //Key channel
uint8_t scancode; //Key scancode
uint32_t state; //1=pressed; 0=releases; 3=keeping pressed
uint32_t almost_known; //Seems something related to modifier keys (CTRL, ALT, SHIFT)
uint16_t UTF16; //key value as an UTF16 char
} key_state; |
Used as argument of key_callback |