/* ******************************************************* * MAIN PROCESSING FUNCTIONS * * Record your shorcuts in each "process key" function * *******************************************************/ fun KEYBOARD_ProcessSHIFTKeys(scancode, asciicode) = 0 ;; fun KEYBOARD_ProcessCTRLSHIFTKeys(scancode, asciicode) = { if KEYBOARD_IsKey scancode KEYCODE_S then GUI_SaveAs else nil } ;; /* ELRIC to be removed ! */ proto SCS_ProcessEachSiteInList = fun [[Site r1]] I ;; fun KEYBOARD_ProcessCTRLKeys(scancode, asciicode) = { /* CTRL - ? */ if KEYBOARD_IsKey scancode KEYCODE_Q then (quit ; 0) else if KEYBOARD_IsKey scancode KEYCODE_W then (GUI_QuickWizard 1; 0) else if KEYBOARD_IsKey scancode KEYCODE_S then (GUI_Save ; 0) else if KEYBOARD_IsKey scancode KEYCODE_N then (SITE_New ; 0) else if KEYBOARD_IsKey scancode KEYCODE_O then (GUI_Open ; 0) else if KEYBOARD_IsKey scancode KEYCODE_A then (GUI_Close ; 0) else if KEYBOARD_IsKey scancode KEYCODE_Z then (GUI_Undo ; 0) else if KEYBOARD_IsKey scancode KEYCODE_Y then (GUI_Redo ; 0) else if KEYBOARD_IsKey scancode KEYCODE_X then (GUI_Cut ; 0) else if KEYBOARD_IsKey scancode KEYCODE_C then (GUI_Copy ; 0) else if KEYBOARD_IsKey scancode KEYCODE_V then (GUI_Paste ; 0) else /* if KEYBOARD_IsKey scancode KEYCODE_P then ((mkfun1 @GUI_ShowHide POPUPWIN_SCSPREF);0) else*/ nil ; } ;; /* WARNING: ALT key doesnt work */ fun KEYBOARD_ProcessALTKeys(scancode, asciicode) = 0;; /* MAT ICI TMP */ proto LINKS_BreakCreation = fun [] I;; fun KEYBOARD_ProcessNormalStateKeys(scancode, asciicode) = { if KEYBOARD_IsKey scancode KEYCODE_ESCAPE then LINKS_BreakCreation else if KEYBOARD_IsKey scancode KEYCODE_DELETE then GUI_Delete else if KEYBOARD_IsKey scancode KEYCODE_BACKSPACE then GUI_SelectFather else if KEYBOARD_IsKey scancode KEYCODE_SPACE then GUI_CreateZone ZONE_ZONE else if KEYBOARD_IsKey scancode KEYCODE_ENTER then GUI_CreateZoneOrEnterBB else if KEYBOARD_IsKey scancode KEYCODE_NUMPAD_ENTER then GUI_CreateZoneOrEnterBB else /* if KEYBOARD_IsKey scancode KEYCODE_F1 then GUI_Help else*/ if KEYBOARD_IsKey scancode KEYCODE_F2 then GUI_ShowHide MAINWIN_MODULE else if KEYBOARD_IsKey scancode KEYCODE_F3 then GUI_ShowHide MAINWIN_ZONE_CLIENT else if KEYBOARD_IsKey scancode KEYCODE_F4 then GUI_ShowHide MAINWIN_ZONE_SERVER else if KEYBOARD_IsKey scancode KEYCODE_F5 then GUI_ShowHide POPUPWIN_SITETREE else if KEYBOARD_IsKey scancode KEYCODE_F6 then GUI_ShowHide POPUPWIN_CREATIONTREE else if KEYBOARD_IsKey scancode KEYCODE_F7 then GUI_ShowHide POPUPWIN_PROPERTIES else if KEYBOARD_IsKey scancode KEYCODE_F8 then GUI_ShowHide POPUPWIN_SITEOPTIONS else if KEYBOARD_IsKey scancode KEYCODE_F9 then GUI_Run else if KEYBOARD_IsKey scancode KEYCODE_F10 then GUI_ShowHide POPUPWIN_ERRORLOG else if KEYBOARD_IsKey scancode KEYCODE_F11 then GUI_ShowHide POPUPWIN_HISTORYLOG else if KEYBOARD_IsKey scancode KEYCODE_F12 then GUI_ShowHide POPUPWIN_SCSPREF else nil ; } ;; fun KEYBOARD_ProcessKeyDownCode(scancode, asciicode) = /* Process your keyboard codes */ { /* _showconsole ; let strcatn (if KEYBOARD_IsSHIFTKeyDown then "SHIFT" else ""):: (if KEYBOARD_IsCTRLKeyDown then "CTRL" else ""):: (if KEYBOARD_IsALTKeyDown then "ALT" else ""):: nil -> stxt in _fooS strcatn "KeyDown event : ("::stxt::" "::(itoa scancode)::") "::nil ; */ /* _fooS KEYBOARD_GetKeyLabel scancode KEYBOARD_GetKeyboardState ;*/ /* SHIFT-ED KEYS */ if KEYBOARD_IsSHIFTKeyDown&&KEYBOARD_IsCTRLKeyDown then (KEYBOARD_ProcessCTRLSHIFTKeys scancode asciicode ; 0) else /* SHIFT-ED KEYS */ if KEYBOARD_IsSHIFTKeyDown then (KEYBOARD_ProcessSHIFTKeys scancode asciicode ; 0) else /* CTRL-ED KEYS */ if KEYBOARD_IsCTRLKeyDown then (KEYBOARD_ProcessCTRLKeys scancode asciicode ; 0) else /* ALT-ED KEYS */ if KEYBOARD_IsALTKeyDown then (KEYBOARD_ProcessALTKeys scancode asciicode ; 0) else /* NORMAL STATE KEYS */ (KEYBOARD_ProcessNormalStateKeys scancode asciicode ; 0) } ;; fun KEYBOARD_ProcessNormalStateUpKeys(scancode, asciicode) = 0 ;; fun KEYBOARD_ProcessSHIFTUpKeys(scancode, asciicode) = { /*if KEYBOARD_IsKey scancode KEYCODE_DOWNARROW then GUI_ShowHide POPUPWIN_SCSPREF else nil ;*/ 1 } ;; fun KEYBOARD_ProcessCTRLUpKeys(scancode, asciicode) = { /*if KEYBOARD_IsKey scancode KEYCODE_DOWNARROW then GUI_ShowHide POPUPWIN_SCSPREF else nil ;*/1 } ;; fun KEYBOARD_ProcessALTUpKeys(scancode, asciicode) = { /*if KEYBOARD_IsKey scancode KEYCODE_DOWNARROW then GUI_ShowHide POPUPWIN_SCSPREF else nil ;*/1 } ;; fun KEYBOARD_ProcessKeyUpCode(scancode, asciicode) = /* Process here your keyboard codes */ { /* _showconsole ; let strcatn (if KEYBOARD_IsSHIFTKeyDown then "SHIFT" else ""):: (if KEYBOARD_IsCTRLKeyDown then "CTRL" else ""):: (if KEYBOARD_IsALTKeyDown then "ALT" else ""):: nil -> stxt in _fooS strcatn "KeyUp event : ("::stxt::" "::(itoa scancode)::") "::nil ; _fooS "- KEYUP events are not handled ! See keyboard handling library -" ; */ /* SHIFT-ED KEYS */ if KEYBOARD_IsSHIFTKeyDown then (KEYBOARD_ProcessSHIFTUpKeys scancode asciicode ; 0) else /* CTRL-ED KEYS */ if KEYBOARD_IsCTRLKeyDown then (KEYBOARD_ProcessCTRLUpKeys scancode asciicode ; 0) else /* ALT-ED KEYS */ if KEYBOARD_IsALTKeyDown then (KEYBOARD_ProcessALTUpKeys scancode asciicode ; 0) else /* NORMAL STATE KEYS */ (KEYBOARD_ProcessNormalStateUpKeys scancode asciicode ; 0) } ;;