#ifndef KEYMAP_H #define KEYMAP_H #include #include "../include/osw-x.h" typedef struct _keymap_struct keymap_struct; #define KEYMAP(p) ((keymap_struct *)(p)) /* * Keymap Codes: * * Each code is an index to an item in xsw_keymap. */ #define XSW_KM_HELP 0 #define XSW_KM_EXIT 1 #define XSW_KM_TURN_LEFT 2 #define XSW_KM_TURN_RIGHT 3 #define XSW_KM_THROTTLE_INC 4 #define XSW_KM_THROTTLE_DEC 5 #define XSW_KM_THROTTLE_IDLE 6 #define XSW_KM_THROTTLE_MAX 7 #define XSW_KM_FIRE_WEAPON 8 #define XSW_KM_OMNI_DIR_THRUST 9 #define XSW_KM_EXTERNAL_DAMPERS 10 #define XSW_KM_LIGHTS_VECTOR 11 #define XSW_KM_LIGHTS_STROBE 12 #define XSW_KM_LIGHTS_LUMINATION 13 #define XSW_KM_WEAPON_FREQ 14 #define XSW_KM_SHIELD 15 #define XSW_KM_SHIELD_FREQ 16 #define XSW_KM_DMGCTL 17 #define XSW_KM_CLOAK 18 #define XSW_KM_INTERCEPT_SET 19 #define XSW_KM_HAIL 20 #define XSW_KM_COM_CHANNEL_SET 21 #define XSW_KM_SEND_MESSAGE 22 #define XSW_KM_IGNORE_OBJECT 23 #define XSW_KM_VIEWSCREEN_ZOOM_IN 24 #define XSW_KM_VIEWSCREEN_ZOOM_OUT 25 #define XSW_KM_VIEWSCREEN_ZOOM_AUTO 26 #define XSW_KM_SCANNER_ZOOM_IN 27 #define XSW_KM_SCANNER_ZOOM_OUT 28 #define XSW_KM_SCANNER_ZOOM_MIN 29 #define XSW_KM_SCANNER_ZOOM_MAX 30 #define XSW_KM_SCANNER_ORIENT 31 #define XSW_KM_ENGINE_STATE 32 #define XSW_KM_THROTTLE_MODE 33 #define XSW_KM_LOCK_NEXT 34 #define XSW_KM_LOCK_NEAREST 35 #define XSW_KM_UNLOCK 36 #define XSW_KM_WEAPONS_ONLINE 37 #define XSW_KM_WEAPON_SELECT_NEXT 38 #define XSW_KM_WEAPON_SELECT_PREV 39 #define XSW_KM_WEAPON_SELECT_1 40 #define XSW_KM_WEAPON_SELECT_2 41 #define XSW_KM_WEAPON_SELECT_3 42 #define XSW_KM_WEAPON_SELECT_4 43 #define XSW_KM_WEAPON_SELECT_5 44 #define XSW_KM_WEAPON_SELECT_6 45 #define XSW_KM_WEAPON_SELECT_7 46 #define XSW_KM_WEAPON_SELECT_8 47 #define XSW_KM_WEAPON_SELECT_9 48 #define XSW_KM_WEAPON_SELECT_10 49 #define XSW_KM_TRACTOR_BEAM_LOCK 50 #define XSW_KM_AUTO_DESTRUCT 51 #define XSW_KM_VS_MARKINGS 52 #define XSW_KM_VS_LABELS 53 #define XSW_KM_ENERGY_SAVER_MODE 54 #define XSW_KM_NET_INTERVAL_INC 55 #define XSW_KM_NET_INTERVAL_DEC 56 #define XSW_KM_MSG_SCROLL_UP 57 #define XSW_KM_MSG_SCROLL_DOWN 58 #define XSW_KM_ECONOMY 59 #define XSW_KM_STARCHART 60 #define XSW_KM_CONNECT 61 #define XSW_KM_CONNECT_LAST 62 #define XSW_KM_DISCONNECT 63 #define XSW_KM_REFRESH 64 #define XSW_KM_CLIENT_CMD 65 #define XSW_KM_SERVER_CMD 66 #define XSW_KM_SCREEN_SHOT 67 /* * Keymaps: */ #define KEYMAPS_LIST { \ { "Help", \ "Help", \ "Prints a listing of basic mapped keys and their respective\n\ functions.", \ 0, 0 \ }, \ { "Exit", \ "Exit", \ "Exits the program.", \ 0, 0 \ }, \ { "TurnLeft", \ "Turn Left", \ "Turns left, or if omni-directional thrust is on, applies thrust\n\ towards starboard.", \ 0, 0 \ }, \ { "TurnRight", \ "Turn Right", \ "Turns right, or if omni-directional thrust is on, applies thrust\n\ towards port.", \ 0, 0 \ }, \ { "ThrottleIncrease", \ "Throttle Increase", \ "Increases the throttle.", \ 0, 0 \ }, \ { "ThrottleDecrease", \ "Throttle Decrease", \ "Decreases the throttle.", \ 0, 0 \ }, \ { "ThrottleIdle", \ "Throttle Idle", \ "Sets the throttle to the idle position.", \ 0, 0 \ }, \ { "ThrottleMax", \ "Throttle Max", \ "Sets the throttle to the maximum position.", \ 0, 0 \ }, \ { "FireWeapon", \ "Fire Weapon", \ "Fire/use the selected device/equipment/weapon.", \ 0, 0 \ }, \ { "OmniDirectionalThrust", \ "Omni Directional Thrust", \ "Switches to the omni-directional thrust mode when held down.", \ 0, 0 \ }, \ { "RetroThrusters", \ "Retro Thrusters", \ "Fires the retro thrusters when held down.", \ 0, 0 \ }, \ { "LightsVector", \ "Lights Vector", \ "Toggles the vector lights on/off.", \ 0, 0 \ }, \ { "LightsStrobe", \ "Lights Strobe", \ "Toggles the strobe lights on/off.", \ 0, 0 \ }, \ { "LightsLumination", \ "Lights Lumination", \ "Toggles the external lumination lights on/off.", \ 0, 0 \ }, \ { "WeaponFreq", \ "Weapon Freq", \ "Changes the weapon frequency.", \ 0, 0 \ }, \ { "ShieldState", \ "Shield State", \ "Toggles the shields on/off.", \ 0, 0 \ }, \ { "ShieldFreq", \ "Shield Freq", \ "Changes the shield frequency.", \ 0, 0 \ }, \ { "DamageControl", \ "Damage Control", \ "Toggles the damage control on/off.", \ 0, 0 \ }, \ { "CloakState", \ "Cloak State", \ "Toggles the cloaking device on/off.", \ 0, 0 \ }, \ { "SetIntercept", \ "Set Intercept", \ "Sets the intercept destination. If the shift key is held down then\n\ this intercepts the current locked-on object.", \ 0, 0 \ }, \ { "Hail", \ "Hail", \ "Sends a general hail on the current com channel to the locked-on\n\ object. If no object is locked-on then a general hail is sent.", \ 0, 0 \ }, \ { "SetChannel", \ "Set Channel", \ "Sets the com channel.", \ 0, 0 \ }, \ { "SendMessage", \ "Send Message", \ "Sends a message on the current com channel.", \ 0, 0 \ }, \ { "IgnoreObject", \ "Ignore Object", \ "Toggles the ignoring or unignoring of all hails and messages sent\n\ by the locked-on object.", \ 0, 0 \ }, \ { "ViewscreenZoomIn", \ "Viewscreen Zoom In", \ "Zooms the viewscreen in.", \ 0, 0 \ }, \ { "ViewscreenZoomOut", \ "Viewscreen Zoom Out", \ "Zooms the viewscreen out.", \ 0, 0 \ }, \ { "ViewscreenAutoZoom", \ "Viewscreen Auto Zoom", \ "Have the viewscreen automatically adjust the zoom based on the\n\ distance of the locked-on object.", \ 0, 0 \ }, \ { "ScannerZoomIn", \ "Scanner Zoom In", \ "Zooms the scanner in.", \ 0, 0 \ }, \ { "ScannerZoomOut", \ "Scanner Zoom Out", \ "Zooms the scanner out.", \ 0, 0 \ }, \ { "ScannerZoomMin", \ "Scanner Zoom Min", \ "Zooms the scanner to match the zoom of the viewscreen.", \ 0, 0 \ }, \ { "ScannerZoomMax", \ "Scanner Zoom Max", \ "Zooms the scanner to its maximum range.", \ 0, 0 \ }, \ { "ScannerOrient", \ "Scanner Orient", \ "Changes the scanner orientation.", \ 0, 0 \ }, \ { "EngineState", \ "Engine State", \ "Starts or shuts down the engines.", \ 0, 0 \ }, \ { "ThrottleMode", \ "Throttle Mode", \ "Changes the throttle mode.", \ 0, 0 \ }, \ { "WeaponsLock", \ "Weapons Lock", \ "Locks on the next object that is within scanner range.", \ 0, 0 \ }, \ { "WeaponsLockNearest", \ "Weapons Lock Nearest", \ "Locks on the nearest object that is within scanner range. If the\n\ shift key is held down then this locks on the nearest home object.", \ 0, 0 \ }, \ { "WeaponsUnlock", \ "Weapons Unlock", \ "Unlocks the current locked-on object. If the shift key is held down\n\ then this disengages the tractor beam.", \ 0, 0 \ }, \ { "WeaponsOnline", \ "Weapons Online", \ "Toggles the weapons online/offline. If the shift key is held down\n\ then the disarm weapon code is sent to all fired weapons.", \ 0, 0 \ }, \ { "SelectWeaponNext", \ "Select Weapon Next", \ "Selects the next weapon.", \ 0, 0 \ }, \ { "SelectWeaponPrev", \ "Select Weapon Prev", \ "Selects the previous weapon.", \ 0, 0 \ }, \ { "SelectWeapon1", \ "Select Weapon 1", \ "Selects weapon 1.", \ 0, 0 \ }, \ { "SelectWeapon2", \ "Select Weapon 2", \ "Selects weapon 2.", \ 0, 0 \ }, \ { "SelectWeapon3", \ "Select Weapon 3", \ "Selects weapon 3.", \ 0, 0 \ }, \ { "SelectWeapon4", \ "Select Weapon 4", \ "Selects weapon 4.", \ 0, 0 \ }, \ { "SelectWeapon5", \ "Select Weapon 5", \ "Selects weapon 5.", \ 0, 0 \ }, \ { "SelectWeapon6", \ "Select Weapon 6", \ "Selects weapon 6.", \ 0, 0 \ }, \ { "SelectWeapon7", \ "Select Weapon 7", \ "Selects weapon 7.", \ 0, 0 \ }, \ { "SelectWeapon8", \ "Select Weapon 8", \ "Selects weapon 8.", \ 0, 0 \ }, \ { "SelectWeapon9", \ "Select Weapon 9", \ "Selects weapon 9.", \ 0, 0 \ }, \ { "SelectWeapon10", \ "Select Weapon 10", \ "Selects weapon 10.", \ 0, 0 \ }, \ { "TractorBeam", \ "Tractor Beam", \ "Engages the tractor beam on the current locked-on object. If the\n\ shift key is held down then this disengages the tractor beam.", \ 0, 0 \ }, \ { "AutoDestruct", \ "Auto Destruct", \ "Begin/abort the auto-destruct sequence.", \ 0, 0 \ }, \ { "ViewscreenMarkings", \ "Viewscreen Markings", \ "Displays/hides the viewscreen markings (such as the vessel\n\ direction arrow, weapons direction arrow, and scanner lock\n\ cursor).", \ 0, 0 \ }, \ { "ViewscreenLabels", \ "Viewscreen Labels", \ "Changes the amount of labeling that is displayed on the\n\ viewscreen.", \ 0, 0 \ }, \ { "EnergySaverMode", \ "Energy Saver Mode", \ "Toggles the Energy Saver Mode on/off (useful for conserving\n\ energy and network bandwidth while at idle).", \ 0, 0 \ }, \ { "NetIntervalIncrement", \ "Net Interval Increment", \ "Increases the network update inverval, thus decreasing the\n\ network load (useable only when auto interval is off).", \ 0, 0 \ }, \ { "NetIntervalDecrement", \ "Net Interval Decrement", \ "Decrease the network update interval, thus increasing the\n\ network load (useable only when auto interval is off).", \ 0, 0 \ }, \ { "MessageScrollUp", \ "Message Scroll Up", \ "Scrolls the bridge window's message box up.", \ 0, 0 \ }, \ { "MessageScrollDown", \ "Message Scroll Down", \ "Scrolls the bridge window's message box down.", \ 0, 0 \ }, \ { "MapEconomy", \ "Map Economy", \ "Maps the Economy (Buy or Sell) window.", \ 0, 0 \ }, \ { "MapStarChart", \ "Map Star Chart", \ "Maps the Star Chart window.", \ 0, 0 \ }, \ { "NetConnect", \ "Net Connect", \ "Connects to a universe.", \ 0, 0 \ }, \ { "NetConnectLast", \ "Net Connect Last", \ "Reconnects to the last connected universe.", \ 0, 0 \ }, \ { "NetDisconnect", \ "Net Disconnect", \ "Disconnects from the current universe.", \ 0, 0 \ }, \ { "NetRefresh", \ "Net Refresh", \ "Reloads the universe database from the server.", \ 0, 0 \ }, \ { "ClientCommand", \ "Client Command", \ "Prompts for a command to be executed on the client.", \ 0, 0 \ }, \ { "ServerCommand", \ "Server Command", \ "Prompts for a command to be executed on the server.", \ 0, 0 \ }, \ { "ScreenShot", \ "Screen Shot", \ "Takes a screen shot and saves it to the downloads directory.", \ 0, 0 \ } \ } /* * Keymap: */ struct _keymap_struct { const char *cfg_name, /* For keymap matching and cfg file * parameter display */ *name, /* Friendly name */ *description; /* Description for the keymap window */ keycode_t keycode; key_state_t key_state; }; /* keymaps.cpp */ extern "C" int KeymapsGetTotal(void); extern "C" keymap_struct *KeymapGetPtr(const int keymap_num); extern "C" keycode_t KeymapGetKeycode(const int keymap_num); #endif /* KEYMAP_H */