D
D
Daniel2021-02-20 13:19:13
Windows
Daniel, 2021-02-20 13:19:13

How to make a service a program that would run on a keystroke?

Is it possible to make it so that it would not check each keystroke (for speed purposes), but only for one specific key (key combination).
Roughly speaking, somewhere in the OS system, there are drivers

switch(keyCode){
        case 1: ....
       case 2: ....   // функции // сюда есть ли возможность что добавить
}

Is it possible to add another feature.
To hang globally and check, for some reason does not seem to be the right solution.
Maybe in windows there are such settings in the registry, somewhere else.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
H
Hemul GM, 2021-02-20
@daniil14056

A regular tool that solves your problem (RegisterHotKey)
https://docs.microsoft.com/en-us/windows/win32/api...
An example of using
https://www.targetprocess.com/blog/hotkeys-binding. ..
https://ourcodeworld.com/articles/read/573/how-to-...

S
Sergey Gornostaev, 2021-02-20
@sergey-gornostaev

It is forbidden. Especially in Java or C#.

V
Vasily Bannikov, 2021-02-20
@vabka

On Windows, you can do this:
https://docs.microsoft.com/en-us/archive/blogs/tou...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question