home *** CD-ROM | disk | FTP | other *** search
- /* keys.h -- Event structures
- Copyright (C) 1993, 1994 John Harper <jsh@ukc.ac.uk>
-
- This file is part of Jade.
-
- Jade 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, or (at your option)
- any later version.
-
- Jade 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 Jade; see the file COPYING. If not, write to
- the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
- /*
- * definition of an event
- */
- typedef struct {
- u_short evd_Type;
- u_short evd_Mods;
- u_long evd_Code;
- } EventDef;
-
- /*
- * actual event read from window.
- */
- typedef struct {
- struct _VW *ev_Window;
- EventDef ev_EventDef;
- u_long ev_Data1;
- u_long ev_Data2;
- #define ev_Data_MouseX ev_Data1
- #define ev_Data_MouseY ev_Data2
- } Event;
-
- #define EV_TYPE_KEYBD 1
- #define EV_TYPE_MOUSE 2
-
- #define EV_MOD_SHIFT 0x0001
- #define EV_MOD_CTRL 0x0002
- #define EV_MOD_MOD1 0x0004
- #define EV_MOD_MOD2 0x0008
- #define EV_MOD_MOD3 0x0010
- #define EV_MOD_MOD4 0x0020
- #define EV_MOD_MOD5 0x0040
- #define EV_MOD_BUTTON1 0x0080
- #define EV_MOD_BUTTON2 0x0100
- #define EV_MOD_BUTTON3 0x0200
- #define EV_MOD_BUTTON4 0x0400
- #define EV_MOD_BUTTON5 0x0800
-
- #define EV_MOD_META EV_MOD_MOD1
-
- #define EV_MOD_LMB EV_MOD_BUTTON1
- #define EV_MOD_MMB EV_MOD_BUTTON2
- #define EV_MOD_RMB EV_MOD_BUTTON3
-
- /*
- * When putting events into a KEYTABLE the low 7 bits of iev_Code are used to
- * get the offset into the table
- */
- #define EV_HASH_MASK 0x7f
-
- /*
- * For EV_TYPE_KEYBD the code is like this,
- * X11:
- * Standard Keysym's
- * Amiga:
- * Normal *raw* keycodes
- */
-
- /*
- * EV_CODE for EV_TYPE_MOUSE events
- */
- #define EV_CODE_MOUSE_CLICK1 1
- #define EV_CODE_MOUSE_CLICK2 2
- #define EV_CODE_MOUSE_MOVE 3
- #define EV_CODE_MOUSE_UP 4
-
- /*
- * Physical structures for key storage,
- */
- typedef struct _Key {
- union {
- struct _Key *next;
- struct MinNode node;
- } ky_Link;
- /*
- * unevaluated object to be evaluated when key is pressed
- */
- VALUE ky_Form;
- EventDef ky_Event;
- } Key;
-
- typedef struct _Keytab {
- u_char kt_Type;
- struct _Keytab *kt_Next; /* next allocated Keytab */
- Key *kt_Keys[128]; /* events are hashed off low 7 bits */
- } Keytab;
-
- typedef struct _Keylist {
- u_char kl_Type;
- struct _Keylist *kl_Next; /* next allocated Keylist */
- struct MinList kl_List;
- } Keylist;
-
-