The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
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
*/
17
struct
kbd_layout_name
18
{
19
uint32_t
index
;
20
char
name
[
KBD_LAYOUT_NAME_MAX
];
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
*/
37
struct
kbd_keymap
38
{
39
char
normal
[
KBD_KEYMAP_KEYS
];
40
char
shift
[
KBD_KEYMAP_KEYS
];
41
char
altgr
[
KBD_KEYMAP_KEYS
];
42
char
altgr_shift
[
KBD_KEYMAP_KEYS
];
43
};
stdint.h
KBD_LAYOUT_NAME_MAX
#define KBD_LAYOUT_NAME_MAX
Definition
kbd.h:13
KBD_KEYMAP_KEYS
#define KBD_KEYMAP_KEYS
Definition
kbd.h:30
uint32_t
unsigned int uint32_t
Definition
fb.h:17
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
drivers
keyboard
keyboard_ioctl.h
Generated by
1.18.0