Right-click using stylus - AutoHotKey help


xeak011's avatar
I hope whoever is reading this is staying safe and healthy in these crazy times.

I have an HP Spectre laptop with a touch screen. I'm using a 3rd-party stylus I bought from Amazon. It works great in every aspect, like it was made for my laptop. The issue is the side button used for "right-clicking". When I press the button, I still have to touch my screen in order to get the right-click to occur.

Normally this wouldn't be an issue, but I recently downloaded Krita, coming from Paint Tool Sai, and found this awesome feature in the Pop Up Pallette that's activated with the right-click. Well, this doesn't work with my stylus because when I hold the button and tap, it sees it as a left-click still.

What I'm needing to do is have my stylus "right-click" while I'm hovering over my monitor. I found this great script for doing exactly that using AutoHotKey. It worked for everything, until I opened Krita, and then I run into the same issue again.

What I'm looking to do now is to add to this script to work with Krita. I've never been very saavy with writing new code, but I'm able to read it well enough to tweak a code to work for me. Any help is much appreciated.

Hover-right-click; This script was adapted from a script graciously provided by
; Justice Frangipane from Tablet Pro (www.tabletpro.net), to
; specifically remap the side button on the Surface Pen to the
; right mouse button while the pen is hovering on the screen.
; In order to run this script, you'll need AutoHotKey and AHKHID.ahk
; AutoHotKey can be downloaded here:
; https://autohotkey.com/foundation/
; AHKHID.ahk can be downloaded here:
; https://github.com/jleb/AHKHID/
; INSTRUCTIONS:
; Place AHKHID.ahk in the same directory as this script, then run the
; following:
; AutoHotKey.exe hover-right-click.ahk
; You can also make a batch file that runs this command and add it to your
; startup folder so that it runs automatically when your PC starts.
; If you find this script useful, consider Tablet Pro as well. It's a cool
; SW and the guys there (Justice) freely shared their knowledge.
; Disclaimer: this script is provided "as is". The author(s) shall not be
; liable for any damage caused by

Comments1
Join the community to add your comment. Already a deviant? Log In