2017-11-30 03:07:30 +00:00
|
|
|
//
|
|
|
|
// Keyboard.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 29/11/2017.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2017 Thomas Harte. All rights reserved.
|
2017-11-30 03:07:30 +00:00
|
|
|
//
|
|
|
|
|
2024-01-17 04:34:46 +00:00
|
|
|
#pragma once
|
2017-11-30 03:07:30 +00:00
|
|
|
|
|
|
|
#include "../KeyboardMachine.hpp"
|
|
|
|
|
|
|
|
namespace MSX {
|
|
|
|
|
|
|
|
enum Key: uint16_t {
|
|
|
|
#define Line(l, k1, k2, k3, k4, k5, k6, k7, k8) \
|
|
|
|
k1 = (l << 4) | 0x07, k2 = (l << 4) | 0x06, k3 = (l << 4) | 0x05, k4 = (l << 4) | 0x04,\
|
|
|
|
k5 = (l << 4) | 0x03, k6 = (l << 4) | 0x02, k7 = (l << 4) | 0x01, k8 = (l << 4) | 0x00,
|
|
|
|
|
|
|
|
Line(0, Key7, Key6, Key5, Key4, Key3, Key2, Key1, Key0)
|
|
|
|
Line(1, KeySemicolon, KeyRightSquareBracket, KeyLeftSquareBracket, KeyBackSlash, KeyEquals, KeyMinus, Key9, Key8)
|
2017-12-21 02:16:54 +00:00
|
|
|
Line(2, KeyB, KeyA, KeyNA, KeyForwardSlash, KeyFullStop, KeyComma, KeyGrave, KeyQuote)
|
2017-11-30 03:07:30 +00:00
|
|
|
Line(3, KeyJ, KeyI, KeyH, KeyG, KeyF, KeyE, KeyD, KeyC)
|
|
|
|
Line(4, KeyR, KeyQ, KeyP, KeyO, KeyN, KeyM, KeyL, KeyK)
|
|
|
|
Line(5, KeyZ, KeyY, KeyX, KeyW, KeyV, KeyU, KeyT, KeyS)
|
|
|
|
Line(6, KeyF3, KeyF2, KeyF1, KeyCode, KeyCaps, KeyGraph, KeyControl, KeyShift)
|
|
|
|
Line(7, KeyEnter, KeySelect, KeyBackspace, KeyStop, KeyTab, KeyEscape, KeyF5, KeyF4)
|
|
|
|
Line(8, KeyRight, KeyDown, KeyUp, KeyLeft, KeyDelete, KeyInsert, KeyHome, KeySpace)
|
|
|
|
Line(9, KeyNumpad4, KeyNumpad3, KeyNumpad2, KeyNumpad1, KeyNumpad0, KeyNumpadDivide, KeyNumpadAdd, KeyNumpadMultiply)
|
|
|
|
Line(10, KeyNumpadDecimal, KeyNumpadComma, KeyNumpadSubtract, KeyNumpad9, KeyNumpad8, KeyNumpad7, KeyNumpad6, KeyNumpad5)
|
|
|
|
|
|
|
|
#undef Line
|
|
|
|
};
|
|
|
|
|
2020-04-02 03:19:34 +00:00
|
|
|
struct KeyboardMapper: public MachineTypes::MappedKeyboardMachine::KeyboardMapper {
|
2020-05-21 03:34:26 +00:00
|
|
|
uint16_t mapped_key_for_key(Inputs::Keyboard::Key key) const final;
|
2017-11-30 03:07:30 +00:00
|
|
|
};
|
|
|
|
|
2024-01-17 04:34:46 +00:00
|
|
|
}
|