Eliasyoussef47 / LockCursorInMonitor

Allows the user to confine the cursor to the monitor it's on when they hold the ctrl key.
17 stars 9 forks source link

Request: Toggle based on active window #14

Open johnhartmann26 opened 2 years ago

johnhartmann26 commented 2 years ago

Is your modification request related to a problem? Please describe. Games on source engine, like CS:GO, will allow you to flick so fast you go onto a second monitor.

Describe the solution you'd like Allow an automatic on/off based on active window, for example csgo.exe

Describe alternatives you've considered Could also just detect fullscreen games, but active window seems easier

Eliasyoussef47 commented 2 years ago

Thank you for making this request. Could you describe how exactly you achieve this (while playing the game) so I can try to replicate it myself. I'll try to look into it but I'm busy with school so I currently can't promise anything.

johnhartmann26 commented 2 years ago

@Eliasyoussef47 Not super familiar with the tech behind this, but this project implements the active window monitoring the way I was hoping for: https://github.com/juv/vibranceGUI

Eliasyoussef47 commented 2 years ago

@johnhartmann26 I'm not sure if you misunderstood my question but I meant how do you flick so fast that the cursor good to the second screen? This still is a useful tip nonetheless.

johnhartmann26 commented 2 years ago

Ah gotcha. It is a fairly common issue that can happen when playing with a high mouse DPI when you flick as fast as possible in the direction of your second monitor and click. This only occurs on Fullscreen mode, not fullscreen windowed. I found this video which shows it being recreated in the first 30 seconds: https://youtu.be/JODjIusXqlM

Eliasyoussef47 commented 2 years ago

@johnhartmann26 understood. And this happens while holding the ctrl key right? How long before doing the flick do you press ctrl?

johnhartmann26 commented 2 years ago

Not necessarily holding any buttons, just flicking the mouse very fast and clicking.

Eliasyoussef47 commented 2 years ago

@johnhartmann26 I'm not sure if there has been a misunderstanding but the functionality of this app is triggered while holding the ctrl key. That was the original idea for this app. Are you suggesting adding a different trigger for this functionality?

johnhartmann26 commented 2 years ago

Hi sorry for the miscommunication! This request was for a different trigger, yes. Instead of it being based on a hotkey, my request would be if it can be based on active window.

MarkMorrow commented 2 years ago

I believe my need is the same. I'm running the Steam game Zuma's Revenge in full screen and if I hold CTRL key it does the job perfectly, but that can be hard on that finger and CTRL key. :) I'd love to see the ability to have it stick (i.e. toggle the hold to current monitor on and off with a key). Please consider. Perhaps this would also solve @johnhartmann26's CS:GO needs too?

Eliasyoussef47 commented 2 years ago

@johnhartmann26 @MarkMorrow I'm sorry for the late response. I thought I've already responded to this. I might be able to implement such functionality but I don't think I have the time. You can check the answers on this forum: https://superuser.com/questions/1088286/how-to-restrict-mouse-to-current-display for possible solutions.

MarkMorrow commented 2 years ago

I certainly understand. I took a crack at it myself and have it working well enough for my purposes. Since you were monitoring both left and right CTRL, I changed logic so right CTRL toggles it to hold mode. It was quick/simple and without UI changes, but not elegant or intuitive enough to post as update. Thanks for creating a very useful utility. :)