summaryrefslogtreecommitdiff
path: root/include/keyboard.h
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2006-09-13 23:49:18 +0000
committerIan C <ianc@noddybox.co.uk>2006-09-13 23:49:18 +0000
commite007fe3daeff4bcd64bd41894d5606fe43948672 (patch)
tree489ae3bf888f235321423b41269bfae463b18c18 /include/keyboard.h
parentf7c8435b666daac5a30c88e462727a6c3dbf584d (diff)
Initail version with Spectrum booting
Diffstat (limited to 'include/keyboard.h')
-rw-r--r--include/keyboard.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/include/keyboard.h b/include/keyboard.h
new file mode 100644
index 0000000..c4d989c
--- /dev/null
+++ b/include/keyboard.h
@@ -0,0 +1,119 @@
+/*
+ dsspec - Nintendo DS Sinclair Spectrum 48K emulator.
+
+ Copyright (C) 2006 Ian Cowburn
+
+ This program 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 2
+ of the License, or (at your option) any later version.
+
+ This program 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 this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ $Id$
+*/
+#ifndef DSSPEC_KEYBOARD_H
+#define DSSPEC_KEYBOARD_H
+
+/* Note that the first 40 values purposefully are the keyboard matrix keys
+*/
+typedef enum
+{
+ SK_1,
+ SK_2,
+ SK_3,
+ SK_4,
+ SK_5,
+
+ SK_6,
+ SK_7,
+ SK_8,
+ SK_9,
+ SK_0,
+
+ SK_Q,
+ SK_W,
+ SK_E,
+ SK_R,
+ SK_T,
+
+ SK_Y,
+ SK_U,
+ SK_I,
+ SK_O,
+ SK_P,
+
+ SK_A,
+ SK_S,
+ SK_D,
+ SK_F,
+ SK_G,
+
+ SK_H,
+ SK_J,
+ SK_K,
+ SK_L,
+ SK_NEWLINE,
+
+ SK_CAPS,
+ SK_Z,
+ SK_X,
+ SK_C,
+ SK_V,
+
+ SK_B,
+ SK_N,
+ SK_M,
+ SK_SYMBOL,
+ SK_SPACE,
+
+ SK_ABOUT,
+ SK_CONFIG,
+ SK_PAD_UP,
+ SK_PAD_DOWN,
+ SK_PAD_LEFT,
+ SK_PAD_RIGHT,
+ SK_PAD_A,
+ SK_PAD_B,
+ SK_PAD_X,
+ SK_PAD_Y,
+ SK_PAD_R,
+ SK_PAD_L,
+ SK_PAD_START,
+ SK_PAD_SELECT,
+
+ NUM_OF_SOFT_KEYS
+} SoftKey;
+
+typedef struct
+{
+ SoftKey key;
+ int pressed;
+} SoftKeyEvent;
+
+
+/* Display the soft keyboard
+*/
+void SK_DisplayKeyboard(uint16 *vram);
+
+/* Returns TRUE while there are still key events for this cycle
+*/
+int SK_GetEvent(SoftKeyEvent *ev);
+
+/* Sets a key to be 'sticky' (it will be released automatically on the next
+ non-sticky press).
+*/
+void SK_SetSticky(SoftKey key, int is_sticky);
+
+/* Flush all the keys.
+*/
+void SK_ClearKeys(void);
+
+#endif /* DSSPEC_KEYBOARD_H */