The preprocessor macros APL and IBM must be defined to specify the compilation target; define APL to 1 and IBM 0 to compile on Macintosh and APL to 0 and IBM to 1 for Windows. You must specify these macro definitions before including XPLMDefs.h or any other XPLM headers. You can do this using the -D command line option or a preprocessor header.
You can prefix your five required callbacks with the PLUGIN_API macro to declare them as exported C functions. The XPLM_API macro identifies functions that are provided to you via the plugin SDK. (Link against XPLM.lib to use these functions.)
typedef int XPLMPluginID;Each plug-in is identified by a unique integer ID. This ID can be used to disable or enable a plug-in, or discover what plug-in is 'running' at the time. A plug-in ID is unique within the currently running instance of X-Plane unless plug-ins are reloaded. Plug-ins may receive a different unique ID each time they are loaded.
For persistent identification of plug-ins, use XPLMFindPluginBySignature in XPLMUtiltiies.h
-1 indicates no plug-in.
The control flag is mapped to the control flag on Macintosh and PC. Generally X-Plane uses the control key and not the command key on Macintosh, providing a consistent interface across platforms that does not necessarily match the Macintosh user interface guidelines. There is not yet a way for plugins to access the Macintosh control keys without using #ifdefed code.
Use virtual key codes to detect keystrokes that do not have ASCII equivalents, allow the user to map the numeric keypad separately from the main keyboard, and detect control key and other modifier-key combinations that generate ASCII control key sequences (many of which are not available directly via character keys in the SDK).
To assign virtual key codes we started with the Microsoft set but made some additions and changes. A few differences:
1. Modifier keys are not available as virtual key codes. You cannot get distinct modifier press and release messages. Please do not try to use modifier keys as regular keys; doing so will almost certainly interfere with users' abilities to use the native x-plane key bindings.
2. Some keys that do not exist on both Mac and PC keyboards are removed.
3. Do not assume that the values of these keystrokes are interchangeable with MS v-keys.
#define XPLM_VK_0 0x30XPLM_VK_0 thru XPLM_VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39)
#define XPLM_VK_A 0x41XPLM_VK_A thru XPLM_VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A)
#define XPLM_VK_EQUAL 0xB0The following definitions are extended and are not based on the Microsoft key set.
All rights reserved. See license.txt for usage.
X-Plane SDK Version: 1.0.2