From 9153766dc9b6e39a9b92915e2edcd8949e346d00 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 27 Nov 2015 11:49:06 -0500 Subject: [PATCH] Added a checkbox for testing uiArea keystroke ignoring. This will be for migrating the Windows keyboard code to using message filters, so we can clean up dialog handling. --- test/page6.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/page6.c b/test/page6.c index b248a3a7..bb9c01f4 100644 --- a/test/page6.c +++ b/test/page6.c @@ -5,6 +5,7 @@ static uiArea *area; static uiCombobox *which; static uiSpinbox *hamount; static uiSpinbox *vamount; +static uiCheckbox *swallowKeys; struct handler { uiAreaHandler ah; @@ -70,7 +71,7 @@ static int handlerKeyEvent(uiAreaHandler *ah, uiArea *a, uiAreaKeyEvent *e) (int) e->Modifier, (int) e->Modifiers, e->Up); - return 0; + return uiCheckboxChecked(swallowKeys); } static void onAmountChanged(uiSpinbox *s, void *data) @@ -130,5 +131,8 @@ uiBox *makePage6(void) uiBoxAppend(hbox, uiControl(vamount), 0); uiBoxAppend(page6, uiControl(hbox), 0); + swallowKeys = uiNewCheckbox("Consider key events handled"); + uiBoxAppend(page6, uiControl(swallowKeys), 0); + return page6; }