How to Set Up a Key Sequence to Trigger a Script?

0
0
Asked By CuriousCoder47 On

I'm working on a script that needs to run continuously on a computer. The goal is to have it listen for a specific sequence of keys. When the user types this sequence, it should take the entire string they entered, paste it into Windows Explorer, and automatically press enter to open the corresponding file. I have a QR code scanner that will be used for input, and the codes will always start with the same 9 characters. I want to set this up so that it functions quietly in the background without showing an input box. Any tips on how to make this work?

3 Answers

Answered By CleverCoder22 On

This is definitely doable; I created something similar using .NET components before. However, be cautious, as most antivirus programs will treat it as a keylogger and flag it. You might want to try using a machine without antivirus to see if that helps with troubleshooting.

CuriousCoder47 -

Exactly! I think my own antivirus is causing issues. I'm looking for a simple trigger to show a message box when I type a specific sequence, but it's just not cooperating. I'll have to check the antivirus settings.

Answered By QRmasterX On

Does your QR scanner have a log feature to track the scans? You could set up something that triggers when a file update happens to get the latest entry, and use event listeners to open the file based on that.

CuriousCoder47 -

I can program the scanner to have a "prefix" before scanning, which could help. Also, I've found out how to type directly in the address bar, but I need to see if my scanner can handle special key commands.

Answered By DevDude89 On

You might want to consider setting up a service for this, but be mindful that what you're describing sounds a lot like keylogging, which antivirus software might flag. There are also tools like Watch Directory that could help you monitor folders for activity, possibly eliminating the need for complex coding.

CodeCrafter123 -

Good point about the antivirus. I plan to stick with PowerShell to avoid third-party keyloggers. I'm looking for a solution that only triggers on specific input, so I'm hoping to find a way to get that working without interference from antivirus.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.