TermOx
Static Public Member Functions | List of all members
ox::Shortcuts Class Reference

Provides functions for defining global keyboard shortcuts. More...

#include <shortcuts.hpp>

Static Public Member Functions

static auto add_shortcut (Key k) -> sl::Signal< void()> &
 Add an entry for the key, returning a Signal to connect an action to. More...
 
static void remove_shortcut (Key k)
 Stop key and its associated Signal from being called. More...
 
static void clear ()
 Remove all shortcuts from the system.
 
static auto send_key (Key k) -> bool
 Call on the associated Signal if key exists as a shortcut. More...
 
static void disable_all ()
 Stop all shortcuts from working.
 
static void enable_all ()
 Allow all shortcuts to be processed, on by default.
 

Detailed Description

Provides functions for defining global keyboard shortcuts.

Member Function Documentation

◆ add_shortcut()

auto ox::Shortcuts::add_shortcut ( Key  k) -> sl::Signal<void()>&
static

Add an entry for the key, returning a Signal to connect an action to.

Key has combined key presses defined for multi-key shortcuts. The returned Signal reference will be called each time the keyboard shortcut is encountered.

◆ remove_shortcut()

void ox::Shortcuts::remove_shortcut ( Key  k)
static

Stop key and its associated Signal from being called.

No-op if key is not an existing shortcut.

◆ send_key()

auto ox::Shortcuts::send_key ( Key  k) -> bool
static

Call on the associated Signal if key exists as a shortcut.

Returns true if the key was used as a shortcut.


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