Skip to content

Hungarian keyboard (code here but dont know how to submit - pls help) #1184

@Guhl-Y

Description

@Guhl-Y

A note for the community

Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.

Disclaimer

  • I have read and understood the disclaimer.
  • I plan to implement the feature myself.

Subsystem

Keyboard

Feature description

Hi All

Unfortunately I have no clue how github works and what I would need to do to have this keyboard layout added to the project. I would be thankful is someone who has some knowledge on how this works could add this small extra. This should add support to the keyboards for Hungarian language. 105 keys qwertz keyboard (default hungarian).

Thanks in advance!

import { KeyboardLayout, KeyCombo } from "../keyboardLayouts";

import { en_US } from "./en_US"; // Fallback for display

const name = "Magyar";
const isoCode = "hu-HU";

// Special accent controllers (Dead keys) and symbols
const keyAcute: KeyCombo = { key: "Digit9", altRight: true }; // accent aigu (acute accent), mark ´ placed above the letter
const keyDoubleAcute: KeyCombo = { key: "Equal", shift: true }; // double acute accent (˝)
const keyTrema: KeyCombo = { key: "Equal", altRight: true }; // diaeresis/umlaut (¨)
const keyCircumflex: KeyCombo = { key: "Digit3", altRight: true }; // circumflex (^)
const keyCedilla: KeyCombo = { key: "Comma", altRight: true }; // cedilla (¸)
const keyGrave: KeyCombo = { key: "Digit7", altRight: true }; // grave accent (`)

const chars = {
  // Letters (QWERTZ)
  A: { key: "KeyA", shift: true },
  Á: { key: "Semicolon", shift: true, accentKey: keyAcute },
  B: { key: "KeyB", shift: true },
  C: { key: "KeyC", shift: true },
  D: { key: "KeyD", shift: true },
  E: { key: "KeyE", shift: true },
  É: { key: "Quote", shift: true, accentKey: keyAcute },
  F: { key: "KeyF", shift: true },
  G: { key: "KeyG", shift: true },
  H: { key: "KeyH", shift: true },
  I: { key: "KeyI", shift: true },
  Í: { key: "IntlBackslash", shift: true, accentKey: keyAcute },
  J: { key: "KeyJ", shift: true },
  K: { key: "KeyK", shift: true },
  L: { key: "KeyL", shift: true },
  M: { key: "KeyM", shift: true },
  N: { key: "KeyN", shift: true },
  O: { key: "KeyO", shift: true },
  Ó: { key: "BracketLeft", shift: true, accentKey: keyAcute },
  Ö: { key: "Minus", shift: true, accentKey: keyTrema },
  Ő: { key: "BracketRight", shift: true, accentKey: keyDoubleAcute },
  P: { key: "KeyP", shift: true },
  Q: { key: "KeyQ", shift: true },
  R: { key: "KeyR", shift: true },
  S: { key: "KeyS", shift: true },
  T: { key: "KeyT", shift: true },
  U: { key: "KeyU", shift: true },
  Ú: { key: "Backslash", shift: true, accentKey: keyAcute },
  Ü: { key: "Equal", shift: true, accentKey: keyTrema },
  Ű: { key: "Backquote", shift: true, accentKey: keyDoubleAcute },
  V: { key: "KeyV", shift: true },
  W: { key: "KeyW", shift: true },
  X: { key: "KeyX", shift: true },
  Y: { key: "KeyZ", shift: true },
  Z: { key: "KeyY", shift: true },
  a: { key: "KeyA" },
  á: { key: "Semicolon", accentKey: keyAcute },
  b: { key: "KeyB" },
  c: { key: "KeyC" },
  d: { key: "KeyD" },
  e: { key: "KeyE" },
  é: { key: "Quote", accentKey: keyAcute },
  f: { key: "KeyF" },
  g: { key: "KeyG" },
  h: { key: "KeyH" },
  i: { key: "KeyI" },
  í: { key: "IntlBackslash", accentKey: keyAcute },
  j: { key: "KeyJ" },
  k: { key: "KeyK" },
  l: { key: "KeyL" },
  m: { key: "KeyM" },
  n: { key: "KeyN" },
  o: { key: "KeyO" },
  ó: { key: "BracketLeft", accentKey: keyAcute },
  ö: { key: "Minus", accentKey: keyTrema },
  ő: { key: "BracketRight", accentKey: keyDoubleAcute },
  p: { key: "KeyP" },
  q: { key: "KeyQ" },
  r: { key: "KeyR" },
  s: { key: "KeyS" },
  t: { key: "KeyT" },
  u: { key: "KeyU" },
  ú: { key: "Backslash", accentKey: keyAcute },
  ü: { key: "Equal", accentKey: keyTrema },
  ű: { key: "Backquote", accentKey: keyDoubleAcute },
  v: { key: "KeyV" },
  w: { key: "KeyW" },
  x: { key: "KeyX" },
  y: { key: "KeyZ" },
  z: { key: "KeyY" },

  // Numbers and top row symbols
  0: { key: "Digit0" },
  "§": { key: "Digit0", shift: true },
  1: { key: "Digit1" },
  "'": { key: "Digit1", shift: true },
  2: { key: "Digit2" },
  '"': { key: "Digit2", shift: true },
  3: { key: "Digit3" },
  "+": { key: "Digit3", shift: true },
  4: { key: "Digit4" },
  "!": { key: "Digit4", shift: true },
  5: { key: "Digit5" },
  "%": { key: "Digit5", shift: true },
  6: { key: "Digit6" },
  "/": { key: "Digit6", shift: true },
  7: { key: "Digit7" },
  "=": { key: "Digit7", shift: true },
  8: { key: "Digit8" },
  "(": { key: "Digit8", shift: true },
  9: { key: "Digit9" },
  ")": { key: "Digit9", shift: true },

  // Full AltGr (altRight) set with accent controllers (accentKey)
  "~": { key: "Digit1", altRight: true },
  "ˇ": { key: "Digit2", altRight: true }, // Breve
  "^": { key: "Digit3", altRight: true },
  "˘": { key: "Digit4", altRight: true },
  "°": { key: "Digit5", altRight: true },
  "˛": { key: "Digit6", altRight: true }, // Ogonek
  "`": { key: "Digit7", altRight: true },
  "˙": { key: "Digit8", altRight: true }, // Dot above
  "´": { key: "Digit9", altRight: true },
  "˝": { key: "Digit0", altRight: true },
  "„": { key: "KeyO", altRight: true },
  "\\": { key: "KeyQ", altRight: true },
  "|": { key: "KeyW", altRight: true },
  "Ä": { key: "KeyE", shift: true, accentKey: keyTrema },
  "ä": { key: "KeyA", accentKey: keyTrema },
  "€": { key: "KeyU", altRight: true },
  "Í": { key: "KeyI", altRight: true, accentKey: keyAcute },
  "Ł": { key: "KeyL", altRight: true, shift: true },
  "đ": { key: "Keys", altRight: true },
  "Đ": { key: "KeyD", altRight: true, shift: true },
  "[": { key: "KeyF", altRight: true },
  "]": { key: "KeyG", altRight: true },
  "ß": { key: "Semicolon", altRight: true },
  "$": { key: "Quote", altRight: true },
  "¤": { key: "Backquote", altRight: true },
  "@": { key: "KeyV", altRight: true },
  "{": { key: "KeyB", altRight: true },
  "}": { key: "KeyN", altRight: true },
  "<": { key: "IntlBackslash", altRight: true },
  ">": { key: "KeyZ", altRight: true },
  "#": { key: "KeyX", altRight: true },
  "&": { key: "KeyC", altRight: true },
  ";": { key: "Comma", altRight: true },
  "*": { key: "Period", altRight: true },
  "÷": { key: "BracketRight", altRight: true },
  "×": { key: "Backslash", altRight: true },

  // Other punctuation marks
  ",": { key: "Comma" },
  "?": { key: "Comma", shift: true },
  ".": { key: "Period" },
  ":": { key: "Period", shift: true },
  "-": { key: "Slash" },
  "_": { key: "Slash", shift: true },
  " ": { key: "Space" },
  "\n": { key: "Enter" },
  Enter: { key: "Enter" },
  Tab: { key: "Tab" },
} as Record<string, KeyCombo>;

const keyDisplayMap = {
  ...en_US.keyDisplayMap,
  Digit0: "0",
  Backquote: "ű",
  Minus: "ö",
  Equal: "ü",
  BracketLeft: "ó",
  BracketRight: "ő",
  Semicolon: "á",
  Quote: "é",
  Backslash: "ú",
  IntlBackslash: "í",
  KeyY: "Z",
  KeyZ: "Y",
} as Record<string, string>;

export const hu_HU: KeyboardLayout = {
  isoCode: isoCode,
  name: name,
  chars: chars,
  keyDisplayMap: keyDisplayMap,
  modifierDisplayMap: {
    ...en_US.modifierDisplayMap,
    altRight: "AltGr",
  },
  virtualKeyboard: en_US.virtualKeyboard,
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions