RegisterHotKey -> (capture SHIFT + A)

  • Thread starter Thread starter Muhammad Arif
  • Start date Start date
M

Muhammad Arif

Dear All,
The following line code capture the key "T"
mModifier = 0
RegisterHotKey(m_appMW.Hwnd, 1, mModifier, VK_T)
The following line of code capture the key combination "ALT + T"
mModifier = 1
RegisterHotKey(m_appMW.Hwnd, 1, mModifier, VK_T)
The following line of code must capture the key combination "SHIFT +
T" but don't capture ...... why ?
mModifier = 4
RegisterHotKey(m_appMW.Hwnd, 1, mModifier, VK_T)

Can some one help me to capture the "SHIFT + T" combination through
RegisterHotKey function.

Regards,
Muhammad Arif
 
I have no problems, in unmanaged code, at least, capturing Shift+T. What is
returned from your call to RegisterHotKey?

Paul T.
 
Dear Paul,
IThe above posted code doesn't work and doesn't raise any exception in
VB.Net. The "fsModifiers" parameter of RegisterHotKey() function works
in case of ALT or CTRL but in case of SHIFT it doesn't work.
I am just looking for the value of "fsModifiers" parameter if the
modifier is SHIFT key.

Regards,
Muhammad Arif
 
That was not what I asked. What does RegisterHotKey ****return**** when you
try to capture Shift+T? You are already using the correct value for the
modifiers for shift: 4.

Paul T.

Muhammad Arif said:
Dear Paul,
IThe above posted code doesn't work and doesn't raise any exception in
VB.Net. The "fsModifiers" parameter of RegisterHotKey() function works
in case of ALT or CTRL but in case of SHIFT it doesn't work.
I am just looking for the value of "fsModifiers" parameter if the
modifier is SHIFT key.

Regards,
Muhammad Arif


"Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
message news: said:
I have no problems, in unmanaged code, at least, capturing Shift+T. What is
returned from your call to RegisterHotKey?

Paul T.
 
Dear Paul,
The RegisterHotKey returns True for shift key modifier as well but
doesn't work properly as the others (Ctrl + T) works. Is the shift key
is captured by RegisterHotKey or not? If yes then please post some
code regarding to my problem.

Regards,
Arif


Paul G. Tobey said:
That was not what I asked. What does RegisterHotKey ****return**** when you
try to capture Shift+T? You are already using the correct value for the
modifiers for shift: 4.

Paul T.

Muhammad Arif said:
Dear Paul,
IThe above posted code doesn't work and doesn't raise any exception in
VB.Net. The "fsModifiers" parameter of RegisterHotKey() function works
in case of ALT or CTRL but in case of SHIFT it doesn't work.
I am just looking for the value of "fsModifiers" parameter if the
modifier is SHIFT key.

Regards,
Muhammad Arif


"Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
message news:<#[email protected]>...
Dear All,
The following line code capture the key "T"
mModifier = 0
RegisterHotKey(m_appMW.Hwnd, 1, mModifier, VK_T)
The following line of code capture the key combination "ALT + T"
mModifier = 1
RegisterHotKey(m_appMW.Hwnd, 1, mModifier, VK_T)
The following line of code must capture the key combination "SHIFT +
T" but don't capture ...... why ?
mModifier = 4
RegisterHotKey(m_appMW.Hwnd, 1, mModifier, VK_T)

Can some one help me to capture the "SHIFT + T" combination through
RegisterHotKey function.

Regards,
Muhammad Arif
 
Yes, it does work. I can't post you any managed code; our macro program is
written in C++. As far as I can tell, it's doing exactly what you are
trying to do, though. Are you sure that you haven't tried to define two hot
keys with the same ID or something? You could write a small application in
C++ with eVC and just verify that it will work there. If not, perhaps it's
an effect of your specific hardware or something.

Paul T.

Muhammad Arif said:
Dear Paul,
The RegisterHotKey returns True for shift key modifier as well but
doesn't work properly as the others (Ctrl + T) works. Is the shift key
is captured by RegisterHotKey or not? If yes then please post some
code regarding to my problem.

Regards,
Arif


"Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
message news: said:
That was not what I asked. What does RegisterHotKey ****return**** when you
try to capture Shift+T? You are already using the correct value for the
modifiers for shift: 4.

Paul T.

Muhammad Arif said:
Dear Paul,
IThe above posted code doesn't work and doesn't raise any exception in
VB.Net. The "fsModifiers" parameter of RegisterHotKey() function works
in case of ALT or CTRL but in case of SHIFT it doesn't work.
I am just looking for the value of "fsModifiers" parameter if the
modifier is SHIFT key.

Regards,
Muhammad Arif


"Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote
in
message news:<#[email protected]>...
Dear All,
The following line code capture the key "T"
mModifier = 0
RegisterHotKey(m_appMW.Hwnd, 1, mModifier, VK_T)
The following line of code capture the key combination "ALT + T"
mModifier = 1
RegisterHotKey(m_appMW.Hwnd, 1, mModifier, VK_T)
The following line of code must capture the key combination "SHIFT +
T" but don't capture ...... why ?
mModifier = 4
RegisterHotKey(m_appMW.Hwnd, 1, mModifier, VK_T)

Can some one help me to capture the "SHIFT + T" combination through
RegisterHotKey function.

Regards,
Muhammad Arif
I have no problems, in unmanaged code, at least, capturing Shift+T. What is
returned from your call to RegisterHotKey?

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top