Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

automation - I need to make a standalone service for detecting and executing custom Windows hotkeys

I am attempting to make a macro keyboard that will automatically open some webpages and programs for me. In order to accomplish this, I have made a custom keyboard that is able to input keystrokes for me.

I would like to use a key combination like ctrl + a + b + c to activate my macros so that it does not interfere with the macros I already have on my keyboard. I have attempted to use Auto Hotkey for this purpose, but it does not accept multiple keys like I want.

I, therefore, believe that I will be forced to code my own hotkey manager. Here are the features That I want to be included in my hotkey manager:

  • Multiple key activation. example: ctrl + a + b + c

  • Ability to open webpages.

  • Ability to run programs.

  • preferably a single program, so that it can be used on multiple computers easily.

Is a project like this possible for an intermediate programmer?

I am currently experimenting with C# and Windows services, but I am unable to figure out how to listen for keystrokes. I am not married to C#. I can change languages as needed.

Any advice you would give is greatly appreciated.

question from:https://stackoverflow.com/questions/65874318/i-need-to-make-a-standalone-service-for-detecting-and-executing-custom-windows-h

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can try using hotstrings instead of a multi-key hotkey.

A hotstring is a sequence of keystrokes.

You can define hotstrings like this

::btw::by the way

Typing "btw" and then a Space or Enter or any word terminator, will expand "btw" to "by the way"

AutoHotKey can also be used to open webpages, run programs etc.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...