V
V
Vitaliy Orlov2017-02-06 12:27:27
C++ / C#
Vitaliy Orlov, 2017-02-06 12:27:27

How to catch pressing Alt+Shift outside my application (globally)?

Greetings!
I want to make a layout indicator floating on the screen.
It is necessary to track the layout change globally. Switching happens on Alt+Shift.
As far as I remember, there are difficulties with registering a global hotkey consisting only of modifier buttons.
Please share the code that allows you to catch Alt + Shift globally, outside of my application.
Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
maaGames, 2017-02-06
@orlov0562

Your indicator will not work with this approach. Now the language is tied to each application, i.e. you can work with several applications at once and each of them will have its own layout and language active. Switching between applications, the language switches and the layout indicator.
Not to mention the fact that I now switch the language with the CAPS_LOCK key.

M
Maxim Moseychuk, 2017-02-06
@fshp

Needs to be tracked globally.

To track something globally, you need to install a hook.

D
Dmitry Bashinsky, 2018-02-22
@BashkaMen

https://www.codeproject.com/Articles/19004/A-Simpl...
Create an instance, add the buttons you want to listen to, and subscribe to the event

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question