|
| 1 | +{ |
| 2 | + This file is part of: |
| 3 | + |
| 4 | + SDL3 for Pascal |
| 5 | + (https://github.com/PascalGameDevelopment/SDL3-for-Pascal) |
| 6 | + SPDX-License-Identifier: Zlib |
| 7 | +} |
| 8 | + |
| 9 | +{* |
| 10 | + * # CategoryPen |
| 11 | + * |
| 12 | + * SDL pen event handling. |
| 13 | + * |
| 14 | + * SDL provides an API for pressure-sensitive pen (stylus and/or eraser) |
| 15 | + * handling, e.g., for input and drawing tablets or suitably equipped mobile / |
| 16 | + * tablet devices. |
| 17 | + * |
| 18 | + * To get started with pens, simply handle SDL_EVENT_PEN_* events. When a pen |
| 19 | + * starts providing input, SDL will assign it a unique SDL_PenID, which will |
| 20 | + * remain for the life of the process, as long as the pen stays connected. |
| 21 | + * |
| 22 | + * Pens may provide more than simple touch input; they might have other axes, |
| 23 | + * such as pressure, tilt, rotation, etc. |
| 24 | + } |
| 25 | + |
1 | 26 | {* |
2 | 27 | * SDL pen instance IDs. |
3 | 28 | * |
|
13 | 38 | PPSDL_PenID = ^PSDL_PenID; |
14 | 39 | PSDL_PenID = ^TSDL_PenID; |
15 | 40 | TSDL_PenID = cuint32; |
| 41 | + |
16 | 42 | {* |
17 | 43 | * Pen input flags, as reported by various pen events' `pen_state` field. |
18 | 44 | * |
|
22 | 48 | PSDL_PenInputFlags = ^TSDL_PenInputFlags; |
23 | 49 | TSDL_PenInputFlags = cuint32; |
24 | 50 |
|
| 51 | +const |
| 52 | + SDL_PEN_INPUT_DOWN = TSDL_PenInputFlags(1 shl 0); {*< pen is pressed down } |
| 53 | + SDL_PEN_INPUT_BUTTON_1 = TSDL_PenInputFlags(1 shl 1); {*< button 1 is pressed } |
| 54 | + SDL_PEN_INPUT_BUTTON_2 = TSDL_PenInputFlags(1 shl 2); {*< button 2 is pressed } |
| 55 | + SDL_PEN_INPUT_BUTTON_3 = TSDL_PenInputFlags(1 shl 3); {*< button 3 is pressed } |
| 56 | + SDL_PEN_INPUT_BUTTON_4 = TSDL_PenInputFlags(1 shl 4); {*< button 4 is pressed } |
| 57 | + SDL_PEN_INPUT_BUTTON_5 = TSDL_PenInputFlags(1 shl 5); {*< button 5 is pressed } |
| 58 | + SDL_PEN_INPUT_ERASER_TIP = TSDL_PenInputFlags(1 shl 30); {*< eraser tip is used } |
| 59 | +
|
25 | 60 | {* |
26 | 61 | * Pen axis indices. |
27 | 62 | * |
|
0 commit comments