scim  1.4.18
scim::FrontEndHotkeyMatcher Class Reference

This class hold all FrontEnd specific Hotkeys, such as trigger keys, on/off keys, etc. More...

#include <scim_hotkey.h>

Public Member Functions

 FrontEndHotkeyMatcher ()
 
 ~FrontEndHotkeyMatcher ()
 
void load_hotkeys (const ConfigPointer &config)
 Load all FrontEnd specific Hotkeys from Config. More...
 
void save_hotkeys (const ConfigPointer &config) const
 Save all FrontEnd specific Hotkeys to Config. More...
 
void add_hotkey (const KeyEvent &key, FrontEndHotkeyAction action)
 Add a Hotkey for an FrontEnd into this FrontEndHotkeyMatcher. More...
 
void add_hotkeys (const KeyEventList &keys, FrontEndHotkeyAction action)
 Add a set of Hotkeys for an FrontEnd into this FrontEndHotkeyMatcher. More...
 
size_t find_hotkeys (FrontEndHotkeyAction action, KeyEventList &keys) const
 Find all Hotkeys binded to a specific action. More...
 
size_t get_all_hotkeys (KeyEventList &keys, std::vector< FrontEndHotkeyAction > &actions) const
 Get all hotkeys in this FrontEndHotkeyMatcher. More...
 
void reset (void)
 Reset the FrontEndHotkeyMatcher. More...
 
void clear (void)
 Clear all Hotkeys and reset the FrontEndHotkeyMatcher. More...
 
void push_key_event (const KeyEvent &key)
 Push a KeyEvent into the queue. More...
 
bool is_matched (void) const
 Check if the last KeyEvent pushed by push_key_event () matched with any Hotkey. More...
 
FrontEndHotkeyAction get_match_result (void) const
 Get the match result. More...
 

Detailed Description

This class hold all FrontEnd specific Hotkeys, such as trigger keys, on/off keys, etc.

Constructor & Destructor Documentation

◆ FrontEndHotkeyMatcher()

scim::FrontEndHotkeyMatcher::FrontEndHotkeyMatcher ( )

◆ ~FrontEndHotkeyMatcher()

scim::FrontEndHotkeyMatcher::~FrontEndHotkeyMatcher ( )

Member Function Documentation

◆ load_hotkeys()

void scim::FrontEndHotkeyMatcher::load_hotkeys ( const ConfigPointer config)

Load all FrontEnd specific Hotkeys from Config.

Parameters
configThe Config object in which the Hotkeys are stored.

◆ save_hotkeys()

void scim::FrontEndHotkeyMatcher::save_hotkeys ( const ConfigPointer config) const

Save all FrontEnd specific Hotkeys to Config.

Parameters
configStore all Hotkeys to this Config object.

◆ add_hotkey()

void scim::FrontEndHotkeyMatcher::add_hotkey ( const KeyEvent key,
FrontEndHotkeyAction  action 
)

Add a Hotkey for an FrontEnd into this FrontEndHotkeyMatcher.

Parameters
keyThe Hotkey.
actionThe action to do when the hotkey is matched.

◆ add_hotkeys()

void scim::FrontEndHotkeyMatcher::add_hotkeys ( const KeyEventList keys,
FrontEndHotkeyAction  action 
)

Add a set of Hotkeys for an FrontEnd into this FrontEndHotkeyMatcher.

Parameters
keysThe Hotkeys.
actionThe action to do when the hotkey is matched.

◆ find_hotkeys()

size_t scim::FrontEndHotkeyMatcher::find_hotkeys ( FrontEndHotkeyAction  action,
KeyEventList keys 
) const

Find all Hotkeys binded to a specific action.

Parameters
actionThe action to be found.
keysA KeyEventList object to hold all KeyEvents binded to the action.
Returns
The number of Hotkeys found.

◆ get_all_hotkeys()

size_t scim::FrontEndHotkeyMatcher::get_all_hotkeys ( KeyEventList keys,
std::vector< FrontEndHotkeyAction > &  actions 
) const

Get all hotkeys in this FrontEndHotkeyMatcher.

Parameters
keysA list of all Hotkeys.
actionsA list of all corresponding actions

◆ reset()

void scim::FrontEndHotkeyMatcher::reset ( void  )

Reset the FrontEndHotkeyMatcher.

The KeyEvent queue will be cleared, all state will be reset. The Hotkeys which were already added will not be touched.

◆ clear()

void scim::FrontEndHotkeyMatcher::clear ( void  )

Clear all Hotkeys and reset the FrontEndHotkeyMatcher.

◆ push_key_event()

void scim::FrontEndHotkeyMatcher::push_key_event ( const KeyEvent key)

Push a KeyEvent into the queue.

This KeyEvent will be matched against the available Hotkeys immediately.

Parameters
keyThe key to be pushed into.

◆ is_matched()

bool scim::FrontEndHotkeyMatcher::is_matched ( void  ) const

Check if the last KeyEvent pushed by push_key_event () matched with any Hotkey.

Returns
true If the KeyEvent matched with a Hotkey.

◆ get_match_result()

FrontEndHotkeyAction scim::FrontEndHotkeyMatcher::get_match_result ( void  ) const

Get the match result.

Returns
The corresponding action of the matched Hotkey.

The documentation for this class was generated from the following file: