Fix inverted touchpad controls in Portrait Mode on Windows Tablets and Convertibles.
When physically rotating a Windows device (e.g., from Landscape to Portrait), Windows rotates the display interface, but does not automatically rotate the mouse or touchpad coordinate system.
This results in "inverted" or "sideways" input—moving your finger "up" on the touchpad causes the cursor to move "left" or "right" on the screen, making the device frustrating to use in tablet mode.
This PowerShell utility acts as a master toggle. With a single hotkey, it cycles through screen orientations and simultaneously injects the correct coordinate profile into the mouse driver.
It Syncs:
- Display Orientation: 0° ➔ 90° ➔ 180° ➔ 270°
- Mouse/Touchpad Axis: Automatically applies the matching rotation matrix.
The script utilizes Raw Accel (a signed kernel-level mouse driver) to handle the input rotation and MultiMonitorTool to handle the display rotation.
It tracks the current state using temporary lockfiles with a custom extension (.positivematician) in the system %TEMP% directory to ensure reliability without requiring Administrator privileges for file creation.
- Raw Accel (Required for mouse rotation).
- MultiMonitorTool (Required for screen rotation - Scroll down to "Feedback" on their site to find the download link).
- PowerShell (Pre-installed on Windows).
The script relies on 4 specific JSON profile files. You must create these manually in your Raw Accel folder (I will add my config files in 'multimonitortool json files' for reference or to be downloaded and used as is):
- Open Raw Accel.
- Set Rotation to
0. Click Apply. - Go to your Raw Accel folder, copy
settings.json, and rename it tolandscape.json. - Repeat this process for the other 3 angles:
- Rotation 90 ➔ Save as
portrait.json - Rotation 180 ➔ Save as
landscape flipped.json - Rotation 270 ➔ Save as
portrait flipped.json
- Rotation 90 ➔ Save as
- Download
ToggleRotation.ps1from this repository. - Open it with any text editor (Notepad, VS Code).
- Update the Configuration section at the top with your specific file paths:
# EXAMPLE CONFIGURATION
$RawAccelWriter = "C:\Users\YourName\Tools\RawAccel\writer.exe"
$ProfileFolder = "C:\Users\YourName\Tools\RawAccel"
$MultiMonitor = "C:\Users\YourName\Tools\MultiMonitorTool.exe"To use this instantly (like a native feature):
- Right-click
ToggleRotation.ps1➔ Send to ➔ Desktop (create shortcut). - Right-click the new Shortcut ➔ Properties.
- In the Target field, add
powershell -WindowStyle Hidden -Filebefore the path. It should look like this:powershell -WindowStyle Hidden -File "C:\Path\To\ToggleRotation.ps1" - Click in the Shortcut Key box and press your desired combo (e.g.,
Ctrl+Alt+R). - Click Apply.
Simply press your hotkey (Ctrl + Alt + R) to cycle through the modes:
- Landscape (Standard Laptop Mode)
- Portrait (Tablet / Reading Mode)
- Landscape Flipped (Tent Mode)
- Portrait Flipped (Reverse Tablet Mode)
Note: The script creates a .positivematician file in your Temp folder to remember which state it is in.
This script works on Windows 10 . It is specifically useful for 2-in-1 convertibles and tablets including:
- Microsoft Surface Pro / Go
- Lenovo Yoga Series
- HP Spectre x360 / Envy x360
- Dell XPS 2-in-1
- Asus ROG Flow / ZenBook Flip
This project is licensed under the MIT License.