Contents

TwKeyPressed (function)

int TwKeyPressed(int key, int modifiers)

Description

Call this function to inform AntTweakBar when a keyboard event occurs.

AntTweakBar interprets this event and acts consequently if it corresponds to a registered key shortcut. So TwKeyPressed has to be called each time your app receives a keyboard event that is not handled directly by your app.

For your convenience, the received key shortcut is displayed at the bottom of the Help bar.

If you are using SDL, GLUT, GLFW or Windows (DirectX), the library provides some helper functions to handle events. See the section how to integrate for more details.

Parameters

key

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

modifiers

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

Return value

See also

TwKeyModifier, TwKeySpecial, TwKeyTest, TwMouseButton, TwMouseMotion, How to integrate