2013-07-06 04:37:13 +00:00
|
|
|
/*
|
2013-06-11 07:08:15 +00:00
|
|
|
* Apple // emulator for Linux: Keyboard definitions
|
|
|
|
*
|
|
|
|
* Copyright 1994 Alexander Jean-Claude Bottema
|
|
|
|
* Copyright 1995 Stephen Lee
|
|
|
|
* Copyright 1997, 1998 Aaron Culliney
|
|
|
|
* Copyright 1998, 1999, 2000 Michael Deutschmann
|
|
|
|
*
|
|
|
|
* This software package is subject to the GNU General Public License
|
2013-07-06 04:37:13 +00:00
|
|
|
* version 2 or later (your choice) as published by the Free Software
|
2013-06-11 07:08:15 +00:00
|
|
|
* Foundation.
|
|
|
|
*
|
2013-07-06 04:37:13 +00:00
|
|
|
* THERE ARE NO WARRANTIES WHATSOEVER.
|
2013-06-11 07:08:15 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-11-24 20:19:54 +00:00
|
|
|
#include "common.h"
|
|
|
|
|
2013-06-11 07:08:15 +00:00
|
|
|
#ifndef A2_KEYS_H
|
|
|
|
#define A2_KEYS_H
|
|
|
|
|
2013-12-30 02:07:24 +00:00
|
|
|
// NOTES:
|
|
|
|
// Ugh, key mapping is a bit schizophrenic... It was originally based on
|
|
|
|
// Linux/SVGAlib raw scancodes that were mapped to a regular or special keycode
|
|
|
|
// through a particular map that corresponded to whether a modifier key such as
|
|
|
|
// shift, control, caps, or a combo, or no modifer was also pressed. The
|
|
|
|
// emulator makes use of both the raw scancodes and the mapped values.
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Scancodes aka "raw" values (range 0-127)
|
|
|
|
|
|
|
|
// raw key scancodes
|
|
|
|
|
|
|
|
#define SCODE_ESC 1
|
|
|
|
|
|
|
|
#define SCODE_BS 14
|
|
|
|
#define SCODE_TAB 15
|
|
|
|
#define SCODE_RET 28
|
2013-07-06 04:37:13 +00:00
|
|
|
#define SCODE_L_CTRL 29
|
|
|
|
#define SCODE_L_SHIFT 42
|
|
|
|
#define SCODE_R_SHIFT 54
|
2013-12-30 02:07:24 +00:00
|
|
|
#define SCODE_L_ALT 56
|
2013-07-06 04:37:13 +00:00
|
|
|
#define SCODE_CAPS 58
|
2013-12-30 02:07:24 +00:00
|
|
|
|
|
|
|
#define SCODE_F1 59
|
|
|
|
#define SCODE_F2 60
|
|
|
|
#define SCODE_F3 61
|
|
|
|
#define SCODE_F4 62
|
|
|
|
#define SCODE_F5 63
|
|
|
|
#define SCODE_F6 64
|
|
|
|
#define SCODE_F7 65
|
|
|
|
#define SCODE_F8 66
|
|
|
|
#define SCODE_F9 67
|
|
|
|
#define SCODE_F10 68
|
|
|
|
#define SCODE_F11 69
|
|
|
|
#define SCODE_F12 70
|
|
|
|
|
|
|
|
#define SCODE_KPAD_UL 71
|
|
|
|
#define SCODE_KPAD_U 72
|
|
|
|
#define SCODE_KPAD_UR 73
|
|
|
|
#define SCODE_KPAD_L 75
|
|
|
|
#define SCODE_KPAD_C 76
|
|
|
|
#define SCODE_KPAD_R 77
|
|
|
|
#define SCODE_KPAD_DL 79
|
|
|
|
#define SCODE_KPAD_D 80
|
|
|
|
#define SCODE_KPAD_DR 81
|
|
|
|
|
|
|
|
#define SCODE_R_CTRL 97
|
|
|
|
#define SCODE_PRNT 99
|
|
|
|
#define SCODE_R_ALT 100
|
|
|
|
#define SCODE_BRK 101
|
|
|
|
|
|
|
|
#define SCODE_HOME 102
|
|
|
|
#define SCODE_U 103
|
|
|
|
#define SCODE_PGUP 104
|
|
|
|
#define SCODE_L 105
|
|
|
|
#define SCODE_R 106
|
|
|
|
#define SCODE_END 107
|
|
|
|
#define SCODE_D 108
|
|
|
|
#define SCODE_PGDN 109
|
|
|
|
#define SCODE_INS 110
|
|
|
|
#define SCODE_DEL 111
|
|
|
|
|
|
|
|
#define SCODE_PAUSE 119
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Keycodes (range 0-255)
|
|
|
|
|
|
|
|
// Apple //e special keycodes
|
|
|
|
|
|
|
|
#define kLT 8
|
|
|
|
#define kTAB 9
|
|
|
|
#define kDN 10
|
|
|
|
#define kUP 11
|
|
|
|
#define kRET 13
|
|
|
|
#define kRT 21
|
|
|
|
#define kESC 27
|
|
|
|
#define kDEL 127
|
|
|
|
|
|
|
|
// Emulator special keycodes (> 127)
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2013-07-06 04:37:13 +00:00
|
|
|
#define kF1 128
|
|
|
|
#define kF2 129
|
|
|
|
#define kF3 130
|
|
|
|
#define kF4 131
|
|
|
|
#define kF5 132
|
|
|
|
#define kF6 133
|
|
|
|
#define kF7 134
|
|
|
|
#define kF8 135
|
|
|
|
#define kF9 136
|
|
|
|
#define kF10 137
|
|
|
|
#define kF11 138
|
|
|
|
#define kF12 139
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2013-12-30 02:07:24 +00:00
|
|
|
// Emulated Joystick
|
2013-07-06 04:37:13 +00:00
|
|
|
#define J_U 141
|
|
|
|
#define J_D 142
|
|
|
|
#define J_L 143
|
|
|
|
#define J_R 144
|
|
|
|
#define JUL 145
|
|
|
|
#define JUR 146
|
|
|
|
#define JDL 147
|
|
|
|
#define JDR 148
|
2013-12-30 02:07:24 +00:00
|
|
|
#define J_C 154
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2013-12-30 02:07:24 +00:00
|
|
|
#define JB0 149 // Alt-L
|
|
|
|
#define JB1 150 // Alt-R
|
|
|
|
#define JB2 151 // NOTE : unused ...
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2013-07-06 04:37:13 +00:00
|
|
|
#define kPAUSE 155
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2013-12-30 02:07:24 +00:00
|
|
|
#define kPGUP 162 // Also : JUR
|
|
|
|
#define kHOME 163 // Also : JUL
|
|
|
|
#define kPGDN 164 // Also : JDR
|
|
|
|
#define kEND 165 // Also : JDL
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2013-12-30 02:07:24 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2013-10-06 08:31:58 +00:00
|
|
|
extern pthread_mutex_t interface_mutex;
|
2014-03-30 18:17:12 +00:00
|
|
|
extern pthread_cond_t cpu_thread_cond;
|
|
|
|
extern pthread_cond_t ui_thread_cond;
|
2014-01-01 19:13:22 +00:00
|
|
|
extern bool caps_lock;
|
2013-06-11 07:08:15 +00:00
|
|
|
|
2014-01-23 04:42:34 +00:00
|
|
|
#ifdef LINUX_JOYSTICK
|
2013-06-11 07:08:15 +00:00
|
|
|
extern int js_fd;
|
|
|
|
extern struct JS_DATA_TYPE js;
|
|
|
|
extern int js_offset_x, js_offset_y;
|
|
|
|
extern float js_adjustlow_x, js_adjustlow_y, js_adjusthigh_x, js_adjusthigh_y;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int c_mygetch(int block);
|
2013-12-28 21:08:35 +00:00
|
|
|
int c_rawkey();
|
2013-12-15 22:59:18 +00:00
|
|
|
void c_keys_set_key(int key);
|
|
|
|
bool c_keys_is_interface_key(int key);
|
2014-08-17 22:29:06 +00:00
|
|
|
int c_keys_is_shifted();
|
|
|
|
int c_keys_ascii_to_scancode(int ch);
|
|
|
|
void c_keys_handle_input(int scancode, int pressed);
|
2013-06-11 07:08:15 +00:00
|
|
|
|
|
|
|
#endif
|