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