VirtualC64 v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
RetroShellTypes.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2// This file is part of VirtualC64
3//
4// Copyright (C) Dirk W. Hoffmann. www.dirkwhoffmann.de
5// This FILE is dual-licensed. You are free to choose between:
6//
7// - The GNU General Public License v3 (or any later version)
8// - The Mozilla Public License v2
9//
10// SPDX-License-Identifier: GPL-3.0-or-later OR MPL-2.0
11// -----------------------------------------------------------------------------
13
14#pragma once
15
16#include "Reflection.h"
17
18namespace vc64 {
19
20//
21// Enumerations
22//
23
25enum_long(RSKEY_KEY)
26{
27 RSKEY_UP,
28 RSKEY_DOWN,
29 RSKEY_LEFT,
30 RSKEY_RIGHT,
31 RSKEY_DEL,
32 RSKEY_CUT,
33 RSKEY_BACKSPACE,
34 RSKEY_HOME,
35 RSKEY_END,
36 RSKEY_TAB,
37 RSKEY_RETURN,
38 RSKEY_SHIFT_RETURN,
39 RSKEY_CR
40};
41typedef RSKEY_KEY RetroShellKey;
42
43struct RetroShellKeyEnum : util::Reflection<RetroShellKeyEnum, RetroShellKey>
44{
45 static constexpr long minVal = 0;
46 static constexpr long maxVal = RSKEY_CR;
47 static bool isValid(auto val) { return val >= minVal && val <= maxVal; }
48
49 static const char *prefix() { return "RSKEY"; }
50 static const char *key(long value)
51 {
52 switch (value) {
53
54 case RSKEY_UP: return "UP";
55 case RSKEY_DOWN: return "DOWN";
56 case RSKEY_LEFT: return "LEFT";
57 case RSKEY_RIGHT: return "RIGHT";
58 case RSKEY_DEL: return "DEL";
59 case RSKEY_CUT: return "CUT";
60 case RSKEY_BACKSPACE: return "BACKSPACE";
61 case RSKEY_HOME: return "HOME";
62 case RSKEY_END: return "END";
63 case RSKEY_TAB: return "TAB";
64 case RSKEY_RETURN: return "RETURN";
65 case RSKEY_SHIFT_RETURN: return "SHIFT_RETURN";
66 case RSKEY_CR: return "CR";
67 }
68 return "???";
69 }
70};
71
72}
VirtualC64 project namespace.
Definition CmdQueue.cpp:16
RSKEY_KEY
RetroShell special key.
Definition RetroShellTypes.h:26