LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
keyboard.c File Reference

(475a4fe LLVM update: finally on 18.x!)

#include "vterm_internal.h"
#include <stdio.h>
#include "utf8.h"
+ Include dependency graph for keyboard.c:

Go to the source code of this file.

Data Structures

struct  keycodes_s
 

Functions

void vterm_keyboard_unichar (VTerm *vt, uint32_t c, VTermModifier mod)
 
void vterm_keyboard_key (VTerm *vt, VTermKey key, VTermModifier mod)
 
void vterm_keyboard_start_paste (VTerm *vt)
 
void vterm_keyboard_end_paste (VTerm *vt)
 

Variables

static keycodes_s keycodes []
 
static keycodes_s keycodes_fn []
 
static keycodes_s keycodes_kp []
 

Function Documentation

◆ vterm_keyboard_end_paste()

void vterm_keyboard_end_paste ( VTerm vt)

Definition at line 222 of file keyboard.c.

References C1_CSI, VTermState::mode, VTerm::state, vt, and vterm_push_output_sprintf_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vterm_keyboard_key()

void vterm_keyboard_key ( VTerm vt,
VTermKey  key,
VTermModifier  mod 
)

Definition at line 128 of file keyboard.c.

References C1_CSI, C1_SS3, keycodes_s::csinum, ESC_S, keycodes, keycodes_fn, keycodes_kp, keycodes_s::literal, VTermState::mode, VTerm::state, keycodes_s::type, vt, VTERM_KEY_FUNCTION_0, VTERM_KEY_FUNCTION_MAX, VTERM_KEY_KP_0, VTERM_KEY_NONE, VTERM_MOD_ALT, VTERM_MOD_CTRL, VTERM_MOD_SHIFT, vterm_push_output_sprintf(), and vterm_push_output_sprintf_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vterm_keyboard_start_paste()

void vterm_keyboard_start_paste ( VTerm vt)

Definition at line 216 of file keyboard.c.

References C1_CSI, VTermState::mode, VTerm::state, vt, and vterm_push_output_sprintf_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vterm_keyboard_unichar()

void vterm_keyboard_unichar ( VTerm vt,
uint32_t  c,
VTermModifier  mod 
)

Definition at line 7 of file keyboard.c.

References C1_CSI, ESC_S, fill_utf8(), vt, VTERM_MOD_ALT, VTERM_MOD_CTRL, VTERM_MOD_SHIFT, vterm_push_output_bytes(), vterm_push_output_sprintf(), and vterm_push_output_sprintf_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ keycodes

keycodes_s keycodes[]
static
Initial value:
= {
{ KEYCODE_NONE },
{ KEYCODE_ENTER, '\r' },
{ KEYCODE_TAB, '\t' },
{ KEYCODE_LITERAL, '\x7f' },
{ KEYCODE_LITERAL, '\x1b' },
{ KEYCODE_CSI_CURSOR, 'A' },
{ KEYCODE_CSI_CURSOR, 'B' },
{ KEYCODE_CSI_CURSOR, 'D' },
{ KEYCODE_CSI_CURSOR, 'C' },
{ KEYCODE_CSINUM, '~', 2 },
{ KEYCODE_CSINUM, '~', 3 },
{ KEYCODE_CSI_CURSOR, 'H' },
{ KEYCODE_CSI_CURSOR, 'F' },
{ KEYCODE_CSINUM, '~', 5 },
{ KEYCODE_CSINUM, '~', 6 },
}

Definition at line 70 of file keyboard.c.

◆ keycodes_fn

keycodes_s keycodes_fn[]
static
Initial value:
= {
{ KEYCODE_NONE },
{ KEYCODE_SS3, 'P' },
{ KEYCODE_SS3, 'Q' },
{ KEYCODE_SS3, 'R' },
{ KEYCODE_SS3, 'S' },
{ KEYCODE_CSINUM, '~', 15 },
{ KEYCODE_CSINUM, '~', 17 },
{ KEYCODE_CSINUM, '~', 18 },
{ KEYCODE_CSINUM, '~', 19 },
{ KEYCODE_CSINUM, '~', 20 },
{ KEYCODE_CSINUM, '~', 21 },
{ KEYCODE_CSINUM, '~', 23 },
{ KEYCODE_CSINUM, '~', 24 },
}

Definition at line 91 of file keyboard.c.

◆ keycodes_kp

keycodes_s keycodes_kp[]
static
Initial value:
= {
{ KEYCODE_KEYPAD, '0', 'p' },
{ KEYCODE_KEYPAD, '1', 'q' },
{ KEYCODE_KEYPAD, '2', 'r' },
{ KEYCODE_KEYPAD, '3', 's' },
{ KEYCODE_KEYPAD, '4', 't' },
{ KEYCODE_KEYPAD, '5', 'u' },
{ KEYCODE_KEYPAD, '6', 'v' },
{ KEYCODE_KEYPAD, '7', 'w' },
{ KEYCODE_KEYPAD, '8', 'x' },
{ KEYCODE_KEYPAD, '9', 'y' },
{ KEYCODE_KEYPAD, '*', 'j' },
{ KEYCODE_KEYPAD, '+', 'k' },
{ KEYCODE_KEYPAD, ',', 'l' },
{ KEYCODE_KEYPAD, '-', 'm' },
{ KEYCODE_KEYPAD, '.', 'n' },
{ KEYCODE_KEYPAD, '/', 'o' },
{ KEYCODE_KEYPAD, '\n', 'M' },
{ KEYCODE_KEYPAD, '=', 'X' },
}

Definition at line 107 of file keyboard.c.