-
Notifications
You must be signed in to change notification settings - Fork 22
/
keyboard.h
115 lines (92 loc) · 2.7 KB
/
keyboard.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#ifndef __KEYBOARD_H__
#define __KEYBOARD_H__
/*****************************************************************************/
/*
Copyright 2015 by Joseph Forgione
This file is part of VCC (Virtual Color Computer).
VCC (Virtual Color Computer) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
VCC (Virtual Color Computer) is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with VCC (Virtual Color Computer). If not, see <http://www.gnu.org/licenses/>.
*/
/*****************************************************************************/
/**
*/
typedef enum keyevent_e
{
kEventKeyUp = 0,
kEventKeyDown = 1
} keyevent_e;
/**
Keyboard layouts
*/
typedef enum keyboardlayout_e
{
kKBLayoutCoCo = 0,
kKBLayoutNatural,
kKBLayoutCompact,
kKBLayoutCustom,
kKBLayoutCount
} keyboardlayout_e;
/**
Keyboard layout names used to populate the
layout selection pull-down in the config dialog
This of course must match keyboardlayout_e above
*/
const char * const k_keyboardLayoutNames[] =
{
"CoCo (DECB)",
"Natural (OS-9)",
"Compact (OS-9)",
"Custom"
} ;
/**
*/
typedef struct keytranslationentry_t
{
unsigned char ScanCode1;
unsigned char ScanCode2;
unsigned char Row1;
unsigned char Col1;
unsigned char Row2;
unsigned char Col2;
} keytranslationentry_t;
typedef struct {
unsigned char UseMouse;
unsigned char Up;
unsigned char Down;
unsigned char Left;
unsigned char Right;
unsigned char Fire1;
unsigned char Fire2;
unsigned char DiDevice;
unsigned char HiRes;
} JoyStick;
/*****************************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif
void vccKeyboardBuildRuntimeTable(keyboardlayout_e keyBoardLayout);
void vccKeyboardHandleKey(unsigned char, unsigned char, keyevent_e keyState);
unsigned char vccKeyboardGetScan(unsigned char);
// globals referenced from config.c
extern JoyStick Left;
extern JoyStick Right;
void joystick(short unsigned, short unsigned);
unsigned short get_pot_value(unsigned char pot);
void SetButtonStatus(unsigned char, unsigned char);
void SetStickNumbers(unsigned char, unsigned char);
#ifdef __cplusplus
}
#endif
/*****************************************************************************/
#endif // __KEYBOARD_H__
bool GetPaste();
void SetPaste(bool);