Difference between revisions of "Nsyskbd.rpl"
Jump to navigation
Jump to search
Rw-r-r 0644 (talk | contribs) |
Rw-r-r 0644 (talk | contribs) |
||
Line 1: | Line 1: | ||
− | nsyskbd.rpl is the system library that allows applications to use USB keyboards plugged in the WiiU USB ports | + | 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 7: | 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> | + | |<code>uint8_t KBDTeardown()</code> |
|Deinitializes the USB keyboard library and return 0 if the deinitialization was successfull | |Deinitializes the USB keyboard library and return 0 if the deinitialization was successfull | ||
|- | |- | ||
− | |<code> | + | |<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 | |Pass arguments to KBDSetup (probably an old function left for compatibility); should returns 0 if successfull | ||
|- | |- | ||
− | |<code> | + | |<code>uint8_t KBDExit();</code> |
|Calls KBDTeardown() (probably an old function left for compatibility); should returns 0 if successfull | |Calls KBDTeardown() (probably an old function left for compatibility); should returns 0 if successfull | ||
|- | |- | ||
Line 28: | Line 28: | ||
|<syntaxhighlight lang="C"> | |<syntaxhighlight lang="C"> | ||
typedef struct { | typedef struct { | ||
− | + | uint8_t ch; //Key channel | |
− | + | uint8_t scancode; //Key scancode | |
− | + | uint32_t state; //1=pressed; 0=releases; 3=keeping pressed | |
− | + | uint8_t unknown[4]; //? | |
− | + | uint16_t UTF16; //Pressed char value in UTF16 | |
} key_state; | } key_state; | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 16:55, 2 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
uint8_t unknown[4]; //?
uint16_t UTF16; //Pressed char value in UTF16
} key_state; |
Used as argument of key_callback |