TwKeyTest (function)

int TwKeyTest(int key, int modifiers)


This function checks if a key event would be processed by TwKeyPressed but without processing it. TwKeyTest could be helpful to prevent bad handling report, for instance when processing WM_KEYUP and WM_KEYDOWN in windows event loop (see file src/TwEventWin.c).



The ASCII code of the key, or one of the TwKeySpecial codes.


One or a OR-ed combination of the TwKeyModifier constants.

Return value

  • 1 if the key event would been handled by AntTweakBar,
  • 0 otherwise.

See also