Skip to content

Commit ae4ac3f

Browse files
Merge pull request #3 from urbanoanderson/development
Development
2 parents ddfe4d5 + ec17c13 commit ae4ac3f

13 files changed

Lines changed: 648 additions & 403 deletions

.vscode/launch.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "C#: XinputWindowsManager Debug",
9+
"type": "dotnet",
10+
"request": "launch",
11+
"projectPath": "${workspaceFolder}/XinputWindowsManager/XinputWindowsManager.csproj"
12+
}
13+
]
14+
}

Images/help-screen.png

11.8 KB
Loading

Images/screenshot1.png

-28.7 KB
Loading

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88

99
## About
1010

11-
This system tray Windows 10 application allows the user to toggle a mouse mode by pressing a special button combination on an Xinput gamepad such as the Xbox One Controller. In this mode, the gamepad is able to freely move the cursor around the screen, perform left and right click actions as well as some useful keyboard presses.
11+
This system tray Windows application allows the user to toggle a desktop manager mode by pressing a special button combination on an Xinput gamepad such as the Xbox One Controller. In this mode, the gamepad is able to freely move the cursor around the screen, perform left and right click actions as well as some useful keyboard presses.
1212

1313
The software was developed so that users with a desktop setup with only gamepad input or at least inconvenient access to keyboard and mouse can perform basic tasks that require these input methods using a gamepad. An example would be my case, where I use a desktop PC with Steam Big Picture in my living room as a DIY game console.
1414

1515
<img src="Images/screenshot1.png" width="100%">
16+
Manager System tray menu
17+
18+
<img src="Images/help-screen.png" caption="caption" width="100%">
19+
Help screen
1620

1721
## Installation
1822

@@ -23,18 +27,43 @@ Optional - If you want the app to start with windows do the following:
2327
1. Create a shortcut of `"XinputWindowsManager.exe"`
2428
2. Place the shortcut inside the following folder: `"C:\Users\<YOURUSERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"`
2529

30+
OR (if first option does not work for controlling desktop):
31+
1. Open Windows "Task Scheduler"
32+
2. Select "Create Task" with Trigger for "At startup" and action "Start a program"
33+
3. It might require selecting "Run with highest privilege" if it still does not launch
34+
2635
## Usage
2736

28-
You can toggle mouse mode by right-clicking the system tray icon and selecting the toggle option or by pressing the following button combination on your xinput controller (player one):
37+
You can toggle manager mode by right-clicking the system tray icon and selecting the toggle option or by pressing the toggle button combination on your xinput controller (player one). Combination can be set in the config file and it defaults to:
2938
- `BACK` + `A` + `X`
3039

3140
While in mouse mode, the following actions can be performed:
3241
- `Left analog stick`: controls mouse cursor movement;
3342
- `A`: performs left click;
3443
- `X`: performs right click;
44+
- `Y`: opens Windows Task Manager (CTRL+SHIFT+ESC);
45+
- `B`: presses ESC key;
46+
- `LS`: opens OnScreen Keyboard;
47+
- `RS`: sends mute command;
48+
- `LT`: presses Windows key;
49+
- `RT`: minimizes all apps (Win+D);
50+
- `LB+RB`: performs performs ALT+TAB;
51+
- `DPAD`: sends arrow keys from keyboard;
52+
- `Right analog stick UP/DOWN`: controls system volume;
53+
- `Right analog stick LEFT/RIGHT`: controls prev/next song;
54+
55+
Other settings can be changes on 'XinputWindowsManager.dll.config' but default values should sufice on most cases.
3556

3657
## Release Notes
3758

59+
### 2.0.0
60+
61+
- Refactors codebase
62+
- Upgrade to .NET 8
63+
- Utilizes XInputium instead of SharpDX for Xinput control
64+
- Utilizes InputSimulatorCore for Keyboard/Mouse control
65+
- Implement a help screen and new shortcuts
66+
3867
### 1.0.0
3968

4069
- Initial version

XinputWindowsManager/App.Config

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<configuration>
2+
<appSettings>
3+
<add key="START_ENABLED" value="false"/>
4+
<add key="XINPUT_POLLING_DELAY_MSECS" value="8"/>
5+
<add key="MAX_CURSOR_MOVEMENT_SPEED" value="18.0"/>
6+
<add key="LEFT_STICK_THRESHOLD" value="0.15"/>
7+
<add key="RIGHT_STICK_THRESHOLD" value="0.70"/>
8+
<add key="TRIGGER_THRESHOLD" value="0.99"/>
9+
<add key="TOGGLE_MANAGER_COMBINATION" value="A,X,BACK"/>
10+
</appSettings>
11+
</configuration>

XinputWindowsManager/DesktopManagerService.cs

Lines changed: 0 additions & 106 deletions
This file was deleted.

XinputWindowsManager/HelpForm.cs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using System;
2+
using System.Windows.Forms;
3+
4+
namespace XinputWindowsManager
5+
{
6+
public class HelpForm : Form
7+
{
8+
public HelpForm()
9+
{
10+
// Setup Help Form
11+
Label label = new Label();
12+
label.Text = "--- XINPUT WINDOWS MANAGER CONTROLS ---" + Environment.NewLine + Environment.NewLine
13+
+ "Left Stick => Mouse Movement" + Environment.NewLine
14+
+ "Left Stick Click => Launch Virtual Keyboard" + Environment.NewLine
15+
+ "A => Mouse Left Click" + Environment.NewLine
16+
+ "X => Mouse Right Click" + Environment.NewLine
17+
+ "Y => Launch Task Manager" + Environment.NewLine
18+
+ "B => Press ESC" + Environment.NewLine
19+
+ "BACK => Press ALT+F4" + Environment.NewLine
20+
+ "START => Press ENTER" + Environment.NewLine
21+
+ "LB => Press Alt" + Environment.NewLine
22+
+ "RB => Press Tab" + Environment.NewLine
23+
+ "LT => Press Windows Key" + Environment.NewLine
24+
+ "RT => Show Help Screen" + Environment.NewLine
25+
+ "Right Stick UP/DOWN => Control System Volume" + Environment.NewLine
26+
+ "Right Stick LEFT/RIGHT => Prev/Next Song" + Environment.NewLine
27+
+ "Right Stick Click => Mute System Sounds" + Environment.NewLine
28+
;
29+
label.Size = new Size(300, 300);
30+
label.Anchor = AnchorStyles.Left;
31+
label.TextAlign = ContentAlignment.TopCenter;
32+
33+
this.Size = label.Size;
34+
this.ShowInTaskbar = false;
35+
this.ShowIcon = false;
36+
this.ControlBox = false;
37+
this.FormBorderStyle = FormBorderStyle.None;
38+
this.StartPosition = FormStartPosition.CenterScreen;
39+
this.Controls.Add(label);
40+
this.SetVisibleCore(false);
41+
}
42+
43+
protected override void OnLoad(EventArgs e)
44+
{
45+
this.Visible = false;
46+
this.Opacity = 0;
47+
this.ShowInTaskbar = false;
48+
49+
base.OnLoad(e);
50+
}
51+
52+
protected override CreateParams CreateParams
53+
{
54+
get
55+
{
56+
CreateParams cp = base.CreateParams;
57+
// turn on WS_EX_TOOLWINDOW style bit
58+
cp.ExStyle |= 0x80;
59+
return cp;
60+
}
61+
}
62+
}
63+
}

0 commit comments

Comments
 (0)