The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
keyboard_ioctl.h
Go to the documentation of this file.
1#pragma once
2
3/**
4 * @file keyboard_ioctl.h
5 * @brief the ioctls of /dev/kbd: list, read and set the keyboard layout.
6 *
7 * the values and the struct are ABI; libc's <sys/kbd.h> has the same.
8 */
9
10#include "common/stdint.h"
11
12#define KBD_LAYOUT_NAME_MAX 32
13
14/**
15 * KBD_IOC_LAYOUT_NAME: the caller sets index; the kernel fills in name.
16 */
17struct kbd_layout_name
18{
21};
22
23#define KBD_IOC_LAYOUT_COUNT 0x4B80 // out: uint32_t, how many layouts there are
24#define KBD_IOC_LAYOUT_NAME 0x4B81 // in/out: struct kbd_layout_name (-EINVAL past the end)
25#define KBD_IOC_GET_LAYOUT 0x4B82 // out: uint32_t, the index of the active layout
26#define KBD_IOC_SET_LAYOUT 0x4B83 // in: uint32_t, the index to make active
27#define KBD_IOC_GET_KEYMAP 0x4B84 // out: struct kbd_keymap, the active layout's tables
28
29#define KBD_KEYMAP_KEYS 128
30
31/**
32 * KBD_IOC_GET_KEYMAP: the characters of the active layout, by key code
33 * (the Linux key code of /dev/input, below 128). 0: the key gives no
34 * character. the characters are ASCII. altgr is for either Alt key (the
35 * Option keys on a Mac keyboard), as on the text console.
36 */
37struct kbd_keymap
38{
43};
#define KBD_LAYOUT_NAME_MAX
Definition kbd.h:13
#define KBD_KEYMAP_KEYS
Definition kbd.h:30
unsigned int uint32_t
Definition fb.h:17
KBD_IOC_GET_KEYMAP: the characters of the active layout, by key code (the Linux key code of /dev/inpu...
Definition kbd.h:39
char shift[KBD_KEYMAP_KEYS]
Definition kbd.h:41
char altgr[KBD_KEYMAP_KEYS]
Definition kbd.h:42
char altgr_shift[KBD_KEYMAP_KEYS]
Definition kbd.h:43
char normal[KBD_KEYMAP_KEYS]
Definition kbd.h:40
KBD_IOC_LAYOUT_NAME: set index; the kernel fills in name.
Definition kbd.h:19
uint32_t index
Definition kbd.h:20
char name[KBD_LAYOUT_NAME_MAX]
Definition kbd.h:21