<commit_before>/*******************************************************************************
 *
 * kit/kernel/keyboard.c
 * - generic keyboard input handler
 *
 * vim:ts=2:sw=2:et:tw=80:ft=c
 *
 * Copyright (C) 2013, <NAME>
 * Redistribution of this file is permitted under the terms of the simplified
 * BSD license. See LICENSE for more information.
 *
 ******************************************************************************/

#include <stddef.h>

#include "keyboard.h"
#include "debug.h"
#include "memory.h"
#include "x86_64.h"

/**
 * +-----+--------+
 * | 0:4 | 5:7    |
 * +-----+--------+
 * | row | column |
 * +-----+--------+
 * <--- 1 byte --->
 *
 * row    = code >> 5;
 * column = code & 0x1f;
 */
static const char keyboard_qwerty_char_map[256] = {
  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  '`', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-',  '=',  0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[',  ']',  '\\', 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '\n', 0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   0,   0,   ' ', 0,   0,   0,   0,   0,   0,   0,   0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
static const char keyboard_qwerty_char_shift_map[256] = {
  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_',  '+',  0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,<commit_msg>[keyboard] map backspace to \b<commit_after>/*******************************************************************************
 *
 * kit/kernel/keyboard.c
 * - generic keyboard input handler
 *
 * vim:ts=2:sw=2:et:tw=80:ft=c
 *
 * Copyright (C) 2013, <NAME>
 * Redistribution of this file is permitted under the terms of the simplified
 * BSD license. See LICENSE for more information.
 *
 ******************************************************************************/

#include <stddef.h>

#include "keyboard.h"
#include "debug.h"
#include "memory.h"
#include "x86_64.h"

/**
 * +-----+--------+
 * | 0:4 | 5:7    |
 * +-----+--------+
 * | row | column |
 * +-----+--------+
 * <--- 1 byte --->
 *
 * row    = code >> 5;
 * column = code & 0x1f;
 */
static const char keyboard_qwerty_char_map[256] = {
  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  '`', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-',  '=',  '\b', 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[',  ']',  '\\', 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '\n', 0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   0,   0,   ' ', 0,   0,   0,   0,   0,   0,   0,   0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
static const char keyboard_qwerty_char_shift_map[256] = {
  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,    0,    0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_',  '+',  0,    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
{'fraction_non_alphanumeric': 0.3950367181564953, 'fraction_numerical': 0.1486452266396556, 'mean_word_length': 2.5585585585585586, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3990376', 'n_tokens_mistral': 2177, 'n_tokens_neox': 2110, 'n_words': 373}