BrlAPI 0.8

brlapi_keycodes.h
Go to the documentation of this file.
1/*
2 * libbrlapi - A library providing access to braille terminals for applications.
3 *
4 * Copyright (C) 2002-2025 by
5 * Samuel Thibault <Samuel.Thibault@ens-lyon.org>
6 * Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>
7 *
8 * libbrlapi comes with ABSOLUTELY NO WARRANTY.
9 *
10 * This is free software, placed under the terms of the
11 * GNU Lesser General Public License, as published by the Free Software
12 * Foundation; either version 2.1 of the License, or (at your option) any
13 * later version. Please see the file LICENSE-LGPL for details.
14 *
15 * Web Page: http://brltty.app/
16 *
17 * This software is maintained by Dave Mielke <dave@mielke.cc>.
18 */
19
23#ifndef BRLAPI_INCLUDED_KEYCODES
24#define BRLAPI_INCLUDED_KEYCODES
25
26#ifdef __cplusplus
27 extern "C" {
28#endif /* __cplusplus */
29
109 typedef uint64_t brlapi_keyCode_t;
110
112#define BRLAPI_KEYCODE_C(value) UINT64_C(value)
113
115#define BRLAPI_PRIxKEYCODE PRIx64
116
118#define BRLAPI_PRIuKEYCODE PRIu64
119
123#define BRLAPI_KEY_MAX UINT64_C(0XFFFFFFFFFFFFFFFF)
124
128#define BRLAPI_KEY_FLAGS_MASK UINT64_C(0XFFFFFFFF00000000)
130#define BRLAPI_KEY_FLAGS_SHIFT 32
131
132#define BRLAPI_KEY_FLG(v) ((brlapi_keyCode_t)(v) << BRLAPI_KEY_FLAGS_SHIFT)
135#define BRLAPI_KEY_FLG_MOD1 BRLAPI_KEY_FLG(0x00000008)
137#define BRLAPI_KEY_FLG_MOD2 BRLAPI_KEY_FLG(0x00000010)
139#define BRLAPI_KEY_FLG_MOD3 BRLAPI_KEY_FLG(0x00000020)
141#define BRLAPI_KEY_FLG_MOD4 BRLAPI_KEY_FLG(0x00000040)
143#define BRLAPI_KEY_FLG_MOD5 BRLAPI_KEY_FLG(0x00000080)
144
145
149#define BRLAPI_KEY_TYPE_MASK UINT64_C(0X00000000E0000000)
151#define BRLAPI_KEY_TYPE_SHIFT 29
153#define BRLAPI_KEY_TYPE_CMD UINT64_C(0X0000000020000000)
155#define BRLAPI_KEY_TYPE_SYM UINT64_C(0X0000000000000000)
156
160#define BRLAPI_KEY_CODE_MASK UINT64_C(0X000000001FFFFFFF)
162#define BRLAPI_KEY_CODE_SHIFT 0
163
165#define BRLAPI_KEY_CMD_BLK_MASK UINT64_C(0X1FFF0000)
167#define BRLAPI_KEY_CMD_BLK_SHIFT 16
169#define BRLAPI_KEY_CMD_ARG_MASK UINT64_C(0X0000FFFF)
171#define BRLAPI_KEY_CMD_ARG_SHIFT 0
172#define BRLAPI_KEY_CMD(v) ((v) << BRLAPI_KEY_CMD_BLK_SHIFT)
173
175#define BRLAPI_KEY_SYM_BACKSPACE UINT64_C(0X0000FF08)
176#define BRLAPI_KEY_SYM_TAB UINT64_C(0X0000FF09)
177#define BRLAPI_KEY_SYM_LINEFEED UINT64_C(0X0000FF0D)
178#define BRLAPI_KEY_SYM_ESCAPE UINT64_C(0X0000FF1B)
179#define BRLAPI_KEY_SYM_HOME UINT64_C(0X0000FF50)
180#define BRLAPI_KEY_SYM_LEFT UINT64_C(0X0000FF51)
181#define BRLAPI_KEY_SYM_UP UINT64_C(0X0000FF52)
182#define BRLAPI_KEY_SYM_RIGHT UINT64_C(0X0000FF53)
183#define BRLAPI_KEY_SYM_DOWN UINT64_C(0X0000FF54)
184#define BRLAPI_KEY_SYM_PAGE_UP UINT64_C(0X0000FF55)
185#define BRLAPI_KEY_SYM_PAGE_DOWN UINT64_C(0X0000FF56)
186#define BRLAPI_KEY_SYM_END UINT64_C(0X0000FF57)
187#define BRLAPI_KEY_SYM_INSERT UINT64_C(0X0000FF63)
188#define BRLAPI_KEY_SYM_FUNCTION UINT64_C(0X0000FFBE)
189#define BRLAPI_KEY_SYM_DELETE UINT64_C(0X0000FFFF)
190#define BRLAPI_KEY_SYM_UNICODE UINT64_C(0X01000000)
191
204#define BRLAPI_DRV_KEY_PRESS BRLAPI_KEYCODE_C(0X8000000000000000)
205
207#define BRLAPI_DRV_KEY_NUMBER_SHIFT 0
209#define BRLAPI_DRV_KEY_NUMBER_MASK 0XFF
211#define BRLAPI_DRV_KEY_NUMBER(code) (((code) & BRLAPI_DRV_KEY_NUMBER_MASK) >> BRLAPI_DRV_KEY_NUMBER_SHIFT)
212
214#define BRLAPI_DRV_KEY_GROUP_SHIFT 8
216#define BRLAPI_DRV_KEY_GROUP_MASK 0XFF00
218#define BRLAPI_DRV_KEY_GROUP(code) (((code) & BRLAPI_DRV_KEY_GROUP_MASK) >> BRLAPI_DRV_KEY_GROUP_SHIFT)
219
221#define BRLAPI_DRV_KEY_VALUE_MASK (BRLAPI_DRV_KEY_GROUP_MASK | BRLAPI_DRV_KEY_NUMBER_MASK)
222
224#define BRLAPI_DRV_KEY_NUMBER_ANY 0XFF
225
228#include "brlapi_constants.h"
229
230#ifdef __cplusplus
231}
232#endif /* __cplusplus */
233
234#endif /* BRLAPI_INCLUDED_KEYCODES */
brlapi_constants.h
brlapi_keyCode_t
uint64_t brlapi_keyCode_t
Definition brlapi_keycodes.h:109