Adding KEYUP events
This commit is contained in:
parent
bd353d37e3
commit
63c5e4949f
2 changed files with 11 additions and 1 deletions
|
@ -67,6 +67,11 @@ static void _shiftTextRight(char* buffer, size_t bufferSize, size_t index, char
|
||||||
#if GINPUT_NEED_KEYBOARD
|
#if GINPUT_NEED_KEYBOARD
|
||||||
static void _keyboardEvent(GWidgetObject* gw, GEventKeyboard* pke)
|
static void _keyboardEvent(GWidgetObject* gw, GEventKeyboard* pke)
|
||||||
{
|
{
|
||||||
|
// Only react on KEYDOWN events. Ignore KEYUP events.
|
||||||
|
if (pke->keystate & GKEYSTATE_KEYUP) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Is it a special key?
|
// Is it a special key?
|
||||||
if (pke->keystate & GKEYSTATE_SPECIAL) {
|
if (pke->keystate & GKEYSTATE_SPECIAL) {
|
||||||
// Arrow keys to move the cursor
|
// Arrow keys to move the cursor
|
||||||
|
|
|
@ -151,6 +151,11 @@ static void gwidgetEvent(void *param, GEvent *pe) {
|
||||||
// If Tab key pressed then set focus to next widget
|
// If Tab key pressed then set focus to next widget
|
||||||
if (pke->bytecount == 1 && pke->c[0] == GKEY_TAB) {
|
if (pke->bytecount == 1 && pke->c[0] == GKEY_TAB) {
|
||||||
|
|
||||||
|
// Only react on KEYDOWN events. Ignore KEYUP events.
|
||||||
|
if (pke->keystate & GKEYSTATE_KEYUP) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the next widget
|
// Get the next widget
|
||||||
bool_t foundWidget = FALSE;
|
bool_t foundWidget = FALSE;
|
||||||
bool_t endOfListDetected = FALSE;
|
bool_t endOfListDetected = FALSE;
|
||||||
|
@ -323,7 +328,7 @@ void _gwidgetInit(void)
|
||||||
geventAttachSource(&gl, ginputGetMouse(GMOUSE_ALL_INSTANCES), GLISTEN_MOUSEMETA|GLISTEN_MOUSEDOWNMOVES);
|
geventAttachSource(&gl, ginputGetMouse(GMOUSE_ALL_INSTANCES), GLISTEN_MOUSEMETA|GLISTEN_MOUSEDOWNMOVES);
|
||||||
|
|
||||||
#if GINPUT_NEED_KEYBOARD
|
#if GINPUT_NEED_KEYBOARD
|
||||||
geventAttachSource(&gl, ginputGetKeyboard(GKEYBOARD_ALL_INSTANCES), 0);
|
geventAttachSource(&gl, ginputGetKeyboard(GKEYBOARD_ALL_INSTANCES), GLISTEN_KEYUP);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue