muteki
Loading...
Searching...
No Matches
event.h File Reference

Low-level UI event handing API. More...

#include <muteki/ui/common.h>

Go to the source code of this file.

Data Structures

struct  key_press_event_config_t
 Configuration struct for key press event generator. More...
 

Enumerations

enum  toggle_key_state_e { TOGGLE_KEY_INACTIVE = 0 , TOGGLE_KEY_ACTIVE , TOGGLE_KEY_TRIGGERED }
 Toggle key states. More...
 

Functions

void GetSysKeyState (key_press_event_config_t *config)
 Read current configuration of key event generator.
 
void SetSysKeyState (const key_press_event_config_t *config)
 Configure key event generator.
 
void ClearAllEvents (void)
 Discard all unprocessed UI events.
 
bool TestPendEvent (ui_event_t *event)
 Process pending events.
 
bool TestKeyEvent (ui_event_t *event)
 Process pending key events.
 
bool GetEvent (ui_event_t *event)
 Get event.
 
void ClearEvent (ui_event_t *event)
 Invalidate an event struct.
 
unsigned short SetShiftState (unsigned short new_state)
 Manually set the state of the SHIFT toggle key.
 
unsigned short SetCapsState (unsigned short new_state)
 Manually set the state of the CAPS toggle key.
 
unsigned short GetShiftState (void)
 Get the state of the SHIFT toggle key.
 
unsigned short GetCapsState (void)
 Get the state of the SHIFT toggle key.
 

Detailed Description

Low-level UI event handing API.

Enumeration Type Documentation

◆ toggle_key_state_e

Toggle key states.

Enumerator
TOGGLE_KEY_INACTIVE 

Toggle key is inactive.

No event will/should be modified.

TOGGLE_KEY_ACTIVE 

Toggle key is active.

Events may modified in case of SHIFT, and should be modified by the user in case of CAPS.

TOGGLE_KEY_TRIGGERED 

Toggle key is triggered and will deactivate itself.

This is only seen on SHIFT where once another key is pressed, the toggle state will be set to this value.

Function Documentation

◆ ClearAllEvents()

void ClearAllEvents ( void  )
extern

Discard all unprocessed UI events.

Syscall Number
0x1004a

Parameters
None.
Returns
None.

◆ ClearEvent()

void ClearEvent ( ui_event_t event)

Invalidate an event struct.

This function zeros out ui_event_t::event_type and ui_event_t::unk20.

Syscall Number
0x10049
Parameters
[out]eventPointer to a ui_event_t struct.

Returns
None.

◆ GetCapsState()

unsigned short GetCapsState ( void  )

Get the state of the SHIFT toggle key.

Syscall Number
0x100af

Parameters
None.

Returns
The current state.
See also
toggle_key_state_e Valid toggle key states.

◆ GetEvent()

bool GetEvent ( ui_event_t event)
extern

Get event.

Exact purpose of this function is currently unclear. It may be responsible for setting some fields in the ui_event_t struct.

Note
This function will block when there is currently no event to be processed.
Syscall Number
0x1003f
Parameters
[out]eventPointer to a ui_event_t struct.
Return values
trueSome events were returned.
falseNo event was returned.

◆ GetShiftState()

unsigned short GetShiftState ( void  )

Get the state of the SHIFT toggle key.

Syscall Number
0x100af

Parameters
None.

Returns
The current state.
See also
toggle_key_state_e Valid toggle key states.

◆ GetSysKeyState()

void GetSysKeyState ( key_press_event_config_t config)

Read current configuration of key event generator.

Syscall Number
0x10032
Parameters
[out]configThe configuration struct for holding the exported configuration.

Returns
None.

See also
key_press_event_config_t The config struct and details on the expected format.

◆ SetCapsState()

unsigned short SetCapsState ( unsigned short  new_state)

Manually set the state of the CAPS toggle key.

Syscall Number
0x100ae
Parameters
new_stateThe new state.
Returns
The previous state.
See also
toggle_key_state_e Valid toggle key states.

◆ SetShiftState()

unsigned short SetShiftState ( unsigned short  new_state)

Manually set the state of the SHIFT toggle key.

Syscall Number
0x100ad
Parameters
new_stateThe new state.
Returns
The previous state.
See also
toggle_key_state_e Valid toggle key states.

◆ SetSysKeyState()

void SetSysKeyState ( const key_press_event_config_t config)

Configure key event generator.

Syscall Number
0x10033
Parameters
[in]configThe configuration struct to be imported.

Returns
None.

See also
key_press_event_config_t The config struct and details on the expected format.

◆ TestKeyEvent()

bool TestKeyEvent ( ui_event_t event)
extern

Process pending key events.

Exact purpose of this function is currently unclear. It is at least responsible for beeping on key presses, etc.

Syscall Number
0x1004b
Parameters
eventpointer to a ui_event_t struct.
Return values
trueSome events were processed.
falseNo event was processed.
See also
TestPendEvent

◆ TestPendEvent()

bool TestPendEvent ( ui_event_t event)
extern

Process pending events.

Exact purpose of this function is currently unclear.

Syscall Number
0x10046
Parameters
eventpointer to a ui_event_t struct.
Return values
trueSome events were processed.
falseNo event was processed.
See also
TestKeyEvent Related function that specifically processes key events.