00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef _HPKEYB49_H
00037 #define _HPKEYB49_H
00038
00039
00040 #ifndef _LONGLONG_DEF
00041 typedef unsigned long long ULONGLONG;
00042 typedef long long LONGLONG;
00043 #define _LONGLONG_DEF
00044 #endif
00045
00145 int keyb_isKeyPressed(unsigned char col, unsigned char row);
00146
00147
00148
00155 int keyb_isAnyKeyPressed(void);
00156
00166 void keyb_waitKeyPressed(void);
00167
00176 int keyb_isLeft(void);
00177
00186 int keyb_isRight(void);
00187
00196 int keyb_isUp(void);
00197
00206 int keyb_isDown(void);
00207
00214 int keyb_isAlpha(void);
00215
00222 int keyb_isLS(void);
00223
00230 int keyb_isRS(void);
00231
00238 int keyb_isON(void);
00239
00268 int keyb_getkey(int wait);
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00323 #define KB_A 41
00325 #define KB_B 42
00327 #define KB_C 43
00329 #define KB_D 44
00331 #define KB_E 45
00333 #define KB_F 46
00335 #define KB_G 47
00337 #define KB_H 53
00339 #define KB_I 54
00341 #define KB_J 55
00343 #define KB_K 57
00345 #define KB_L 58
00347 #define KB_M 33
00349 #define KB_N 25
00351 #define KB_O 17
00353 #define KB_P 9
00355 #define KB_Q 34
00357 #define KB_R 26
00359 #define KB_S 18
00361 #define KB_T 10
00363 #define KB_U 2
00365 #define KB_V 35
00367 #define KB_W 27
00369 #define KB_X 19
00371 #define KB_Y 11
00373 #define KB_Z KB_DIV
00375 #define KB_0 31
00377 #define KB_1 30
00379 #define KB_2 22
00381 #define KB_3 14
00383 #define KB_4 29
00385 #define KB_5 21
00387 #define KB_6 13
00389 #define KB_7 28
00391 #define KB_8 20
00393 #define KB_9 12
00395 #define KB_BKS 1
00397 #define KB_DIV 3
00399 #define KB_MUL 4
00401 #define KB_ADD 6
00403 #define KB_SUB 5
00405 #define KB_DOT 23
00407 #define KB_SPC 15
00409 #define KB_ENT 7
00411 #define KB_UP 49
00413 #define KB_DN 51
00415 #define KB_LF 50
00417 #define KB_RT 52
00419 #define KB_ALPHA 60
00421 #define KB_LSHIFT 61
00423 #define KB_RSHIFT 62
00425 #define KB_ON 63
00426
00427
00434 #define KB_MASK64(a) (((ULONGLONG)1)<<(a))
00435
00443 #define KB_MASK32(a) (((unsigned int)1)<<(a&31))
00444
00452 #define KB_MASK8(a) (((unsigned int)1)<<(a&7))
00453
00454
00455
00456
00466 #define KB_CURS ((ULONGLONG)0x001e000000000000)
00467
00468
00478 #define KBH_CURS32 ((unsigned int)0x001e0000)
00479
00480
00490 #define KB_FUNC ((ULONGLONG)0x00007e0000000000)
00491
00501 #define KBH_FUNC32 ((unsigned int)0x00007e00)
00502
00503
00504
00505
00507 #define SHFT_LS 0x40000000
00509 #define SHFT_RS 0x20000000
00511 #define SHFT_ALPHA 0x10000000
00513 #define SHFT_ON 0x80000000
00515 #define SHFT_ANY 0xf0000000
00516
00517
00519 #define KEYCODE(shftcode) ((shftcode)&0xff)
00521 #define SHFTPLANE(shftcode) ((shftcode)&0xf0000000)
00522
00523
00524
00533 typedef union {
00534 ULONGLONG full;
00535 struct { unsigned int loword,hiword; };
00536 unsigned char bytes[8];
00537 } keymatrix;
00538
00539
00549 extern void keyb_getmatrix(keymatrix *ptr);
00550
00563 int keyb_isKeyPrM(int keycode);
00564
00578 int keyb_isShiftKeyPrM(int shiftcode);
00579
00580
00613 int keyb_getkeyM(int wait);
00614
00642 int keyb_getnextkey(keymatrix *ptr,int keycode);
00643
00644
00645
00646 #define WAIT_CANCEL {while(keyb_isON()); while(! keyb_isON());}
00647
00648 #endif