Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions A320UE/A320UE.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,32 @@
<ProjectGuid>{3684F283-A3DB-48E7-BD8F-C9351A38138F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>A320UE</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions BetterMouseYoke/BetterMouseYoke.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,32 @@
<ProjectGuid>{D9E54848-F19F-4DBD-B4EC-4871922541CA}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>BetterMouseYoke</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
Expand Down
36 changes: 32 additions & 4 deletions BetterMouseYoke/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define PLUGIN_DESCRIPTION "Does away with X-Plane's idiotic centered little box " \
"for mouse steering that has caused much grieve and " \
"countless loss of virtual lives."
#define PLUGIN_VERSION "1.5"
#define PLUGIN_VERSION "1.5.1"

#define RUDDER_DEFL_DIST 200
#define RUDDER_RET_SPEED 2.0f
Expand Down Expand Up @@ -45,6 +45,35 @@ static HCURSOR yoke_cursor;
static HCURSOR rudder_cursor;
static HCURSOR arrow_cursor;
static HCURSOR(WINAPI *true_set_cursor) (HCURSOR cursor) = SetCursor;

static BOOL CALLBACK find_xplane_window_cb(HWND hwnd, LPARAM lParam)
{
char class_name[64] = { 0 };
if (GetClassNameA(hwnd, class_name, sizeof(class_name))) {
if (strcmp(class_name, "X-System") == 0) {
HWND *out = (HWND *)lParam;
*out = hwnd;
return FALSE;
}
}
return TRUE;
}

static int find_xplane_window(HWND *out_hwnd)
{
*out_hwnd = NULL;
if (EnumWindows(find_xplane_window_cb, (LPARAM)out_hwnd) && *out_hwnd) {
return 1;
}
if (*out_hwnd) {
return 1;
}
*out_hwnd = FindWindowA("X-System", "X-System");
if (*out_hwnd) {
return 1;
}
return 0;
}
#endif

/**
Expand Down Expand Up @@ -94,9 +123,8 @@ PLUGIN_API int XPluginStart(char *name, char *sig, char *desc) {
rudder_defl_dist = ini_geti("rudder_deflection_distance", RUDDER_DEFL_DIST);
rudder_ret_spd = ini_getf("rudder_return_speed", RUDDER_RET_SPEED);
#ifdef IBM
xp_hwnd = FindWindowA("X-System", "X-System");
if (!xp_hwnd) {
_log("could not find X-Plane 11 window");
if (!find_xplane_window(&xp_hwnd)) {
_log("could not find X-Plane window");
return 0;
}
if (!hook_set_cursor(1)) {
Expand Down
10 changes: 5 additions & 5 deletions CycleQuickLooks/CycleQuickLooks.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@
<ProjectGuid>{9FD9E482-7A36-4B3A-B352-79C35D744F98}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>CycleQuickLooks</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions MouseButtons/MouseButtons.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,32 @@
<ProjectGuid>{71988D8C-AEF8-45DB-8609-69E6F6315C71}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>MouseButtons</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
Expand Down
36 changes: 32 additions & 4 deletions MouseButtons/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define PLUGIN_DESCRIPTION "Enables the use of extra mouse buttons and allows " \
"the right mouse button and mouse wheel to be re-" \
"assigned to arbitrary commands."
#define PLUGIN_VERSION "1.0"
#define PLUGIN_VERSION "1.0.1"

/**
* X-Plane 11 Plugin Entry Point.
Expand Down Expand Up @@ -96,6 +96,35 @@ PLUGIN_API void XPluginReceiveMessage(XPLMPluginID from, int msg, void *param) {
static HWND xp_hwnd;
static WNDPROC old_wnd_proc;

static BOOL CALLBACK find_xplane_window_cb(HWND hwnd, LPARAM lParam)
{
char class_name[64] = { 0 };
if (GetClassNameA(hwnd, class_name, sizeof(class_name))) {
if (strcmp(class_name, "X-System") == 0) {
HWND* out = (HWND*)lParam;
*out = hwnd;
return FALSE;
}
}
return TRUE;
}

static int find_xplane_window(HWND* out_hwnd)
{
*out_hwnd = NULL;
if (EnumWindows(find_xplane_window_cb, (LPARAM)out_hwnd) && *out_hwnd) {
return 1;
}
if (*out_hwnd) {
return 1;
}
*out_hwnd = FindWindowA("X-System", "X-System");
if (*out_hwnd) {
return 1;
}
return 0;
}

static mbutton_t wm_to_mbutton(UINT msg, WPARAM wParam, int *state) {
switch (msg) {
case WM_LBUTTONDOWN:
Expand Down Expand Up @@ -169,9 +198,8 @@ LRESULT CALLBACK xp_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam,
}

int hook_wnd_proc() {
xp_hwnd = FindWindowA("X-System", "X-System");
if (!xp_hwnd) {
_log("could not find X-Plane 11 window");
if (!find_xplane_window(&xp_hwnd)) {
_log("could not find X-Plane window");
return 0;
}
old_wnd_proc = (WNDPROC)SetWindowLongPtrA(xp_hwnd, GWLP_WNDPROC,
Expand Down
10 changes: 5 additions & 5 deletions PluginLoader/PluginLoader.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,32 @@
<ProjectGuid>{6A2982AA-8DC6-4217-94ED-87D956767507}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>PluginLoader</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions ToggleMouseLook/ToggleMouseLook.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,32 @@
<ProjectGuid>{5AF5AA8B-673B-4D43-B077-EB5F9AAAE4A5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ToggleMouseLook</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
Expand Down
36 changes: 32 additions & 4 deletions ToggleMouseLook/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define PLUGIN_SIG "S22.ToggleMouseLook"
#define PLUGIN_DESCRIPTION "Adds new commands for better control of mouse " \
"look inside the cockpit."
#define PLUGIN_VERSION "1.2"
#define PLUGIN_VERSION "1.2.1"

static XPLMCommandRef toggle_mouse_look;
static XPLMCommandRef hold_mouse_look;
Expand Down Expand Up @@ -130,6 +130,35 @@ int draw_cb(XPLMDrawingPhase phase, int before, void *ref) {
static HWND xp_hwnd;
static WNDPROC old_wnd_proc;

static BOOL CALLBACK find_xplane_window_cb(HWND hwnd, LPARAM lParam)
{
char class_name[64] = { 0 };
if (GetClassNameA(hwnd, class_name, sizeof(class_name))) {
if (strcmp(class_name, "X-System") == 0) {
HWND* out = (HWND*)lParam;
*out = hwnd;
return FALSE;
}
}
return TRUE;
}

static int find_xplane_window(HWND* out_hwnd)
{
*out_hwnd = NULL;
if (EnumWindows(find_xplane_window_cb, (LPARAM)out_hwnd) && *out_hwnd) {
return 1;
}
if (*out_hwnd) {
return 1;
}
*out_hwnd = FindWindowA("X-System", "X-System");
if (*out_hwnd) {
return 1;
}
return 0;
}

LRESULT CALLBACK xp_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam) {
switch (msg) {
Expand All @@ -149,9 +178,8 @@ LRESULT CALLBACK xp_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam,
}

int hook_wnd_proc() {
xp_hwnd = FindWindowA("X-System", "X-System");
if (!xp_hwnd) {
_log("could not find X-Plane 11 window");
if (!find_xplane_window(&xp_hwnd)) {
_log("could not find X-Plane window");
return 0;
}
old_wnd_proc = (WNDPROC) SetWindowLongPtrA(xp_hwnd, GWLP_WNDPROC,
Expand Down
Loading