-
Notifications
You must be signed in to change notification settings - Fork 88
glgui event
Jonathan Chan edited this page Jul 20, 2018
·
2 revisions
glgui-event process an input event. It loops over all guis provided and sends events to their widgets's input handlers. It is mainly found in the second function (the loop) of the main program declaration.
Parameter | Description |
---|---|
g | Graphical User Interface (GUI) or a list of GUIs |
t | Event type, e.g. EVENT_KEYPRESS |
x0 | First argument of event, e.g. x coordinate pixels or keyboard character |
y0 | Second argument of event, e.g. y coordinate in pixels or modifier flags |
If t
is an EVENT_KEYPRESS
or EVENT_KEYRELEASE
event, y0
will have its bits set according to the modifier keys that are on, as described below.
Modifier key(s) | Constant name(s) | Constant value | Corresponding bit, where the rightmost bit is the zeroth bit |
---|---|---|---|
Control (macOS) | MODIFIER_CTRL_MAC | 1 | 0 |
Control (Windows)/Command (macOS) | MODIFIER_CTRL/MODIFIER_CMD | 2 | 1 |
Alt (Windows)/Option (macOS) | MODIFIER_ALT/MODIFIER_OPT | 4 | 2 |
Shift | MODIFIER_SHIFT | 8 | 3 |
Caps Lock | MODIFIER_CAPS | 16 | 4 |
Function | MODIFIER_FN | 32 | 5 |
Example from apps/DemoRedSquare/main.scm
(lambda (t x y)
(if (= t EVENT_KEYPRESS) (begin (if (= x EVENT_KEYESCAPE) (terminate))))
(glgui-event gui t x y)
)
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip