home *** CD-ROM | disk | FTP | other *** search
- /*
- * keyosk.c: hterm keyboard decoder for OS-9/680x0 and OS-9000
- *
- * Author: HIRANO Satoshi
- * (C) 1989 Halca Computer Science Laboratory TM
- * University of Tokyo
- *
- * Edition History:
- * 1.1 90/02/03 Halca.Hirano creation
- *
- * $Header: keyosk.cv 1.1 90/02/03 14:01:38 hirano Exp $
- */
-
-
- #include "hterm.h"
-
- void keyInit()
- /* iniz keyboard mode */
- {
- clickFlag = DEFAULT_KEY_CLICK;
- applKeypad = DEFAULT_APP_KEYBOARD;
- applCursor = DEFAULT_CURSOR_KEY_MODE;
- newline = DEFAULT_NEWLINE_MODE;
- asckey = YES; /* always ascii keyboard */
- mouseSpeed = DEFAULT_MOUSE_SPEED;
- bsKeyCount = keyCount = 0;
- bsKeyRatio = DEFAULT_BS_KEY_RATIO;
-
- mouseInit();
- }
-
- keySetup()
- /* setup keyboard mode */
- {}
-
- keyEnd()
- {
- mouseEnd();
- }
-
- int checkKey()
- /*
- * return 0 if key buffer is empty
- */
- {
- if (_gs_rdy(0) == -1)
- return(NO);
- else
- return(YES);
- }
-
- short keyin()
- /*
- * check keyboard status and return key if available
- * return:
- * -1 key is not available
- * 00xx ASCII, kana
- * xxyy hterm kanji code
- * xx00 special key code
- */
- {
- short c, c2;
- char buf[2];
-
- if (_gs_rdy(0) == -1)
- return(-1);
-
- read(0, buf, 1);
- c = buf[0];
-
- timerValue = timerLoadValue;
- keyCount++;
-
- if (clickFlag == YES)
- click();
-
- #ifdef KANJI
- if (isSJIS1(c)) { /*if kanji start */
- while (_gs_rdy(0) == -1)
- ;
- read(0, buf, 1);
- c2 = buf[0];
- return(SJIStoJIS(c, c2));
- }
- return((u_short)c);
- }
-
- keyMode()
- {
- /* nothing to do */
- }
-
- setBSDel()
- {
- /* not needed */
- }
-
- editPFKey()
- {
- }
-
- editSPFKey()
- {
- }
-
- editCursorKey()
- {
- }
-
- editAppCursorKey()
- {
- }
-
- editAppKeyPad()
- {
- }
-
- saveKey(fd)
- int fd;
- /*
- * save key pad string, cursor key string, pf key string
- */
- {
- }
-
- loadKey(fd)
- int fd;
- /*
- * load key pad string, cursor key string, pf key string
- */
- {
- }
-
- void FAR mouseEvent() {}
- mouseOnOff() {}
- mouseSetPosition() {}
- mouseEnd() {}
- mouseInit() {}
-
-