* Initializes the TelCom Event manager system * Call this as soon as possible * You can call it whenever the events need to be flushed */
| 2398 | * You can call it whenever the events need to be flushed |
| 2399 | */ |
| 2400 | void TelComInitEventManager(void) { |
| 2401 | int i; |
| 2402 | |
| 2403 | for (i = 0; i < MAX_TELCOM_EVENTS; i++) { |
| 2404 | Telcom_system.Telcom_event_queue[i].id = -1; |
| 2405 | } |
| 2406 | for (i = 0; i < TCSYS_MAXKEYS; i++) { |
| 2407 | Telcom_system.Telcom_systemkey_states[i] = false; |
| 2408 | } |
| 2409 | |
| 2410 | // Setup the key translation table |
| 2411 | Telcom_system.TranslateSysKey[TCSYS_TAB] = KEY_TAB; |
| 2412 | Telcom_system.TranslateSysKey[TCSYS_UP] = KEY_UP; |
| 2413 | Telcom_system.TranslateSysKey[TCSYS_DOWN] = KEY_DOWN; |
| 2414 | Telcom_system.TranslateSysKey[TCSYS_LEFT] = KEY_LEFT; |
| 2415 | Telcom_system.TranslateSysKey[TCSYS_RIGHT] = KEY_RIGHT; |
| 2416 | Telcom_system.TranslateSysKey[TCSYS_ENTER] = KEY_ENTER; |
| 2417 | Telcom_system.TranslateSysKey[TCSYS_SPACE] = KEY_SPACEBAR; |
| 2418 | Telcom_system.TranslateSysKey[TCSYS_Q] = KEY_Q; |
| 2419 | Telcom_system.TranslateSysKey[TCSYS_F1] = KEY_F1; |
| 2420 | Telcom_system.TranslateSysKey[TCSYS_F2] = KEY_F2; |
| 2421 | Telcom_system.TranslateSysKey[TCSYS_F3] = KEY_F3; |
| 2422 | Telcom_system.TranslateSysKey[TCSYS_PRINTSCRN] = KEY_PRINT_SCREEN; |
| 2423 | Telcom_system.TranslateSysKey[TCSYS_1] = KEY_1; |
| 2424 | Telcom_system.TranslateSysKey[TCSYS_2] = KEY_2; |
| 2425 | Telcom_system.TranslateSysKey[TCSYS_3] = KEY_3; |
| 2426 | Telcom_system.TranslateSysKey[TCSYS_4] = KEY_4; |
| 2427 | Telcom_system.TranslateSysKey[TCSYS_5] = KEY_5; |
| 2428 | Telcom_system.TranslateSysKey[TCSYS_6] = KEY_6; |
| 2429 | Telcom_system.TranslateSysKey[TCSYS_7] = KEY_7; |
| 2430 | Telcom_system.TranslateSysKey[TCSYS_8] = KEY_8; |
| 2431 | Telcom_system.TranslateSysKey[TCSYS_REVERSETAB] = KEY_TAB + KEY_SHIFTED; |
| 2432 | |
| 2433 | Telcom_system.Telcom_mouse_downtime = 0; |
| 2434 | } |
| 2435 | |
| 2436 | /* |
| 2437 | * Enables/Disables a TelCom system key, pass in TCSYS_MAXKEYS to enable/disable all keys |