GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
AG_GLOBALKEYS(3) FreeBSD Library Functions Manual AG_GLOBALKEYS(3)

AG_GlobalKeys
agar application-wide keyboard shortcuts

#include <agar/core.h>
#include <agar/gui.h>

The AG_GlobalKeys interface associates application-wide keyboard shortcuts to specified callback routines.

Note that AG_GlobalKeys entirely ignores the status of Agar windows and widgets. To implement keyboard operations specific to a given Agar window or widget, one would instead use AG_ActionOnKeyDown(3) or AG_ActionOnKeyUp(3). For a more low-level interface to keyboard processing, the base AG_Widget(3) class also provides the ‘key-down’ and ‘key-up’ event handlers.

void
AG_BindGlobalKey(AG_KeySym key, AG_KeyMod mod, void (*fn)(void));


void
AG_BindGlobalKeyEv(AG_KeySym key, AG_KeyMod mod, void (*fn)(AG_Event *));


void
AG_BindStdGlobalKeys(void);


int
AG_UnbindGlobalKey(AG_KeySym key, AG_KeyMod mod);


void
AG_ClearGlobalKeys(void);

AG_BindGlobalKey() binds the specified routine to the given key combination. Keys are represented by AG_KeySym enums, and acceptable values for sym and mod arguments are listed under AG_KeySym(3) and AG_KeyMod(3).

The AG_BindGlobalKeyEv() variant accepts an AG_Event(3) style function. Note that arguments of AG_KEY_ANY and AG_KEYMOD_ANY are acceptable, in which case any key or key modifier will be matched.

The AG_BindStdGlobalKeys() routine sets up the standard key bindings:

CTRL+EQUALS / META+EQUALS
AG_ZoomIn(3)
CTRL+MINUS / META+MINUS
AG_ZoomOut(3)
CTRL+0 / META+0
AG_ZoomReset(3)
CTRL+Q / META+Q
AG_QuitGUI(3)
ESCAPE
AG_CloseFocusedWindow(3)

AG_UnbindGlobalKey() removes the given key mapping. AG_ClearGlobalKeys() removes all existing key mappings.

AG_Intro(3), AG_Keyboard(3), AG_KeyMod(3), AG_KeySym(3), AG_Widget(3), AG_Window(3)

The AG_GlobalKeys interface first appeared in Agar 1.0. AG_BindStdGlobalKeys() first appeared in Agar 1.5.0.
September 21, 2009 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.