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_KEYBOARD(3) FreeBSD Library Functions Manual AG_KEYBOARD(3)

AG_Keyboardagar direct keyboard interface

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

The AG_Keyboard interface provides a direct interface to keyboard status. This manual page also documents a few utility routines for dealing with Agar keyboard symbols. The AG_Keyboard object itself is registered and accessed through the AG_Driver(3) interface.

AG_Object(3) -> AG_InputDevice(3) -> AG_Keyboard.

const char *
(AG_KeySym sym);


char *
(AG_KeyMod mod);


AG_KeySym
(const char *name);


int *
(AG_Widget *widget);


int
(AG_Widget *widget);


void
(AG_Widget *widget, int *keyState);


Uint
(AG_Widget *widget);


void
(AG_Widget *widget, Uint modState);


int
(Uint modState, const char *flags);

The () function returns a pointer to a statically-allocated, user-readable string describing the given AG_KeySym(3) (or NULL if the argument is out of range).

The () function returns a dynamically-allocated, user-readable string describing the given AG_KeyMod(3).

() returns a keysym value for the specified name (or AG_KEY_NONE if no match was found).

The () function returns a pointer to an array of integers which represent the current keyboard status. The array has up to AG_KEY_LAST entries (see AG_KeySym(3)). AG_GetKeyCount() returns the number of entries in the keyboard status array.

The () routine overwrites the keyboard status array with the contents of keyState (which should have AG_KEY_LAST entries).

() returns the current keyboard modifier status (see AG_KeyMod(3)). AG_SetModState() overwrites the current modifier status with the value of modState.

The () function compares a modifier status against a string of flags, returning 1 if any of the modifiers described by the string are active, or 0 otherwise. No distinction is made between left and right-sided modifiers. The string may contain "C" for CTRL, "A" for ALT, "S" for SHIFT, and "M" for META.

AG_Keyboard *
AG_KeyboardNew(AG_Driver *drv, const char *descr);


void
(AG_Keyboard *kbd, AG_KeyboardAction action, AG_KeySym sym);


int
(AG_Keyboard *kbd, AG_Window *win, AG_KeyboardAction action, AG_KeySym sym, Uint32 unicode);

The () function registers a new keyboard device under the specified AG_Driver(3).

When a keyboard event is received by the driver, it should call () to update Agar's internal keyboard status as soon as the event is received. Typically, AG_KeyboardUpdate() is called by the () routine of the driver (see AG_GetNextEvent(3)).

The () function is called to perform final processing of key press and key release events (sending ‘key-up’ and ‘key-down’ events to the appropriate Agar widgets). Typically, AG_ProcessKey() is called from the () routine of the driver (see AG_ProcessEvent(3)). The agDrivers must be locked.

() and AG_ProcessKey() accept the same arguments. action should be AG_KEY_PRESSED or AG_KEY_RELEASED. The sym argument is the Agar virtual key (see AG_KeySym(3)), and unicode is the Unicode character value. Either (but not both) arguments may be undefined. sym may be set to AG_KEY_NONE if there is no corresponding Agar virtual key, and unicode may be set to 0 if there is no corresponding Unicode character (as should be the case for function keys).

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

The AG_Keyboard interface first appeared in Agar 1.4.0 and the widget interface was first documented in Agar 1.5.0.

December 21, 2022 Agar 1.7

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.