/*
 * Touch Panel Event definitions
 */
#define	EV_DOWN		0
#define	EV_UP		1
#define	EV_MOVE		2
#define	EV_BUTTON	3
#define	EV_MODEM	4
#define	EV_TICK		5	/* 0.5 sec event */
#define	EV_HTICK	6	/* 1 sec event */
#define	EV_MTICK	7	/* midnight event */

#define	EV_QSTEER	0x10	/* Event from Q-STEER IR controller */

#define	EV_SDCARD	0x20	/* Event from SD card status change */

#define	FLG_TICK	(1 << EV_TICK)
#define	FLG_HTICK	(1 << EV_HTICK)

#define	TICK_MARK	0x100	/* Mark for TICK/HTICK notification */
#define	IR_MARK		0x200	/* Mark for Q-STEER IR commands */
#define	DISK_MARK	0x400	/* Mark for SD status change notification */
#define	MARK_MASK	0xf00
#define	MARK_VALUE	0x0ff

#ifndef _MACRO_ONLY
struct touch_event {
  UB ev_type;
  H  ev_xpos, ev_ypos;
#ifdef USE_Z_AXIS
  H  ev_zpos;
#endif
  UH ev_button;
  SYSTIM ev_time;
};
#endif

#define	TOUCHEV_SIZE	sizeof(struct touch_event)
#define	TOUCHQ_LEN	6

#define	BUT_HOME	(('H' << 8) | 'O')
#define	BUT_MAIL	(('M' << 8) | 'A')
#define	BUT_NOTE	(('N' << 8) | 'O')
#define	BUT_PHONE	(('P' << 8) | 'H')
#define	BUT_MUSIC	(('M' << 8) | 'U')

#define	MDM_RING	(('R' << 8) | 'I')
#define	MDM_ALERT	(('A' << 8) | 'L')
#define	MDM_DISC	(('D' << 8) | 'I')
#define	MDM_CALLERID	(('C' << 8) | 'I')
#define	MDM_CONN	(('C' << 8) | 'O')
#define	MDM_NOCARRIER	(('N' << 8) | 'C')

#define	KEY_0		'0'
#define	KEY_1		'1'
#define	KEY_2		'2'
#define	KEY_3		'3'
#define	KEY_4		'4'
#define	KEY_5		'5'
#define	KEY_6		'6'
#define	KEY_7		'7'
#define	KEY_8		'8'
#define	KEY_9		'9'
#define	KEY_ASTERISK	'*'
#define	KEY_NUMBER	'#'
#define	KEY_CLEAR	'L'
#define	KEY_CALL	'C'
#define	KEY_DISC	'D'
#define	KEY_RECORD	'R'
#define	KEY_STOP	'S'

#define	KEY_VPLAY	(('V' << 8) | 'P')
#define	KEY_VSTOP	(('V' << 8) | 'S')
#define	KEY_VSUSPEND	(('V' << 8) | 'U')
#define	KEY_VRESUME	(('V' << 8) | 'R')
#define	KEY_VSLIDER	(('V' << 8) | 'L')
#define	KEY_VAREA	(('V' << 8) | 'A')
#define	KEY_VREWIND	(('V' << 8) | 'W')
