Git Product home page Git Product logo

mousetrap's Introduction

MouseTrap

Build

MouseTrap is a small tool to map the cursor between multiple monitors with
different resolutions and scaling settings.

Min requirements

For this tool to function correctly you should have:

  • At least Windows 10 Creators update (Build 1703)
  • .NET 8 Runtime (in most cases it will notify you if the runtime is missing)

Download and Setup

You can find the latest release here:

Download

You can install MouseTrap with chocolatey:

# install the package
choco install mousetrap

# running it
mousetrap

Changelog

Version 1.0.20

  • Add chocolatey support

Version 1.0.19

  • Migrate to .NET 8
  • Discontinue chocolatey support
  • Migrate CI to Github Actions
  • Bug fixes

Version 1.0.15

  • Migrate to .NET 6
  • Bug fixes

Version 1.0.6

  • Migrate to .NET 5 (from legacy .NET Framework)
  • Adds Diagnostic Window
    • Realtime Log Viewer
    • Configutation Viewer
    • LogFile Viewer
  • Implements a potential fix for #2 Unexpected Cursor Teleportation
  • Adds an option to disable Mouse teleportation - That's usefull while gaming in fullscreen!
  • Lots of smaller bugfixes

Usage and Configuration

You can always find your running MouseTrap app as a system-tray icon in the right corner of your Taskbar. Right-clicking the icon shows some options:

Option Description
Settings Open configuration screen
Mouse teleportation Checkbox Turn off mouse teleportation e.g. while gaming
Exit Fully exit MouseTrap process

NOTE: reinit can be triggered by commandline: mousetrap --reinit

Tray icon

Hit Settings on the menu and you see a screen like in the following picture, where you can see your monitors and their alignment. or better how Windows sees them. (Windows has no clue how big your screens are).
Hit Configure Screen Bridges to configure how this tool maps your mouse pointer between Monitors.
And don't forget to check the checkbox on the left, if it isn't already, to ensure MouseTrap starts automatically if your computer turns off and on again.

Settings Screen

Configure Screen Bridges

On the configuration, screen hit the '+' buttons to add bridges between your Monitors.
Then resize them to match your physical screen size.

Look at the pictures to get an idea of how it should look.

Config Screen

The blue-reddish bar should cover the space where you want to move your mouse-pointer between your Monitors.
And it counts the hole size, from red tip to red tip.

Bridge

Bridge top Bridge bottom Bridge

You can always test your Settings before saving them.
Exit this configuration screen by hitting your ESC key or by hitting the Close button.

Test and save

If you encounter any bugs don't hesitate to open an issue and I will give my best to fix it.

mousetrap's People

Contributors

r-larch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rowa notalltim

mousetrap's Issues

Wireless KVM Switch Capability Upgrade

I looked through Mousetrap and Git pages, but didn't find any support for separate monitors w/separate computers.

Mousetrap would benefit from incorporating Wi-Fi KVM switch functionality, like Mouse with Borders, Symless, etc. Adapting the simpler form of Wi-Fi KVM switch, like Mouse Without Borders does, is the perfect fit for Mousetrap.

With that requested, I have a small bug.

I installed Mousetrap on one machine and it works great. However, the second's Mousetrap app wouldn't detect .NET runtime installed. When Mousetrap doesn't find .NET, it offers a dialog to download that package. However, when I'd click Yes to download the .NET, nothing happened.
Then, after manually installing .NET runtime v8.02, Mousetrap doesn't detect it. After the .NET install, I also gave the machine a reboot, in case that was needed. However, executing the Mousetrap command still results in a hard stop - the dialog box to download .NET runtime. Only v8.02 was installed, so no other .NET versions are present. TIA

I'm using Windows 10 Pro Build 19045 with PowerShell v7.4.1.

Teleportation fails intermittently

Hello!

Sometimes when I move the mouse from one screen to another, it will not correctly move the cursor.
For these times, it will behave as if the application was not enabled (default mouse move behavior)
I believe I was able to catch these events using the diagnostics tool

The message seems to be

0:00:01,4019406           3 [ ]  Cursor(  55,  546)  MouseTrap({X=0,Y=0,Width=2560,Height=1440}) system had wrong clip: {X=-1920,Y=0,Width=4480,Height=1440}   -- IsInputDesktop: True

Update:
Never mind the previous log after playing around a bit more I was able to get:

0:00:47,6273076         477 [↖]  Cursor(   0, 1063)  MouseTrapClear(0)
0:00:47,6274518         479 [↖]  Cursor(   0, 1063)      Move To Screen -> {X=-1920,Y=0,Width=1920,Height=1080}
0:00:47,6274475         478 [↖]  Cursor(   0, 1063)      Δ src-dst: -2 - 2  smallJump: True
0:00:47,627455          480 [↖]  Cursor(   0, 1063)      MouseMove     (  -3,  797)
0:00:47,6277254         481 [↖]  Cursor(   0, 1063)      Move Failed ! (   0, 1063) - Retry

But it doesn't always seem to log this when the switching fails. So I don't really know what's going on.

New diagnostics
mousetrap-diag.txt

Despite the last message saying "Retry", it didn't really retry

Add commanline support for reinit

Commandline support for reinit command would be great. Currently if you resume from sleep, you need to do "reinit" from tray bar. It would be easier if we could just add a task to do this and call reinit via commandline.

Sometimes: Unhandled exception while user is logging in.

Application: MouseTrap.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
at System.Linq.Enumerable.First[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable1<System.__Canon>, System.Func2<System.__Canon,Boolean>)
at MouseTrap.MouseBrigeService.Loop()
at MouseTrap.MouseBrigeService.Run()
at MouseTrap.ServiceThread+<>c__DisplayClass7_0.b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

Setup 2 screen bridges on the same side for a single monitor

Hi, I use a 3 monitors set-up, with a widescreen (21:9 25") over my laptop monitors (16:9, 15"), as shown in the picture bellow.
image

Unfortunately, I can't setup 2 screen bridges on the same side of my monitor. It would be perfect if I could, as my widescreen is placed over my two other screens.
If I put only one bridge, I have, depending on how far I stretch the upper bridge, either one of my 2 other screen is left-off, either an uncomfortable experience with the 2 bellow monitors sharing the same bridge of the upper monitor (picture bellow).
image

Can you help me through this?
Thank you for you help!

Fullscreen Games

Hello
There is a problem that occures in certain games. Lately i discovered it in Layers of Fear 2 , and Pacify. When you turn to one side mouse can go to the second monitor and click out of the game. After closing MouseTrap the problem is gone. I believe it's bad implementation of Fullscreen mode of the game but is there any way to fix it?

Window sizes

Hi,
Your program is great and uses much less resources than competition in form of LittleBigMouse.
However is there a way to implement dragging resized windows? so the transition from bigger to smaller monitor looks seamless?

Pause/Resume QOL Fixes

There are two things that I think can be improved with the temporary disabling of mouse teleportation.

  1. Adding an option to pause/resume in the right-click menu of the tray icon. This would make it easier to pause before opening a fullscreen game
  2. Auto-detection for pause/resume. My thinking was something similar to BorderlessGaming where you can add a proccess/exe that, when started, would automatically pause the mouse teleportation until it is closed. For example, I know Genshin Impact doesn't work with mouse teleportation, so I would add the game's process or exe to a list so that mouse teleportation is disabled as long as the game is still running.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.