The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
keyboard_layout.h File Reference

Keyboard layout definitions. More...

#include "common/stdint.h"

Go to the source code of this file.

Data Structures

struct  keyboard_layout_t
 a keyboard layout maps PS/2 scan codes to characters. More...

Functions

const keyboard_layout_t * keyboard_get_layout (void)
 get the active keyboard layout.
const keyboard_layout_t * keyboard_layout_at (uint32_t index)
 a built-in layout by its index (layouts.c has the list).
uint32_t keyboard_layout_index (void)
 the index of the active layout.
bool keyboard_set_layout (uint32_t index)
 make a built-in layout the active one.
const keyboard_layout_t * layout_dk_mac (void)
 the layouts (each in its own file).
const keyboard_layout_t * layout_us (void)

Detailed Description

Keyboard layout definitions.

This file defines the structure for keyboard layouts, which map PS/2 scan codes to characters. It includes support for normal, shift, and AltGr (Right Alt / Option) mappings, as well as a combined AltGr + Shift mapping.

Function Documentation

◆ keyboard_get_layout()

const keyboard_layout_t * keyboard_get_layout ( void )

get the active keyboard layout.

Returns
pointer to the active layout.

◆ keyboard_layout_at()

const keyboard_layout_t * keyboard_layout_at ( uint32_t index)

a built-in layout by its index (layouts.c has the list).

Returns
the layout, or NULL past the last one.

◆ keyboard_layout_index()

uint32_t keyboard_layout_index ( void )

the index of the active layout.

◆ keyboard_set_layout()

bool keyboard_set_layout ( uint32_t index)

make a built-in layout the active one.

the next key press uses it.

Returns
false if there is no layout with this index.

◆ layout_dk_mac()

const keyboard_layout_t * layout_dk_mac ( void )

the layouts (each in its own file).

◆ layout_us()

const keyboard_layout_t * layout_us ( void )