News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Keyboard Help - ALT Key

Started by dedndave, April 12, 2011, 03:05:35 PM

Previous topic - Next topic

dedndave

yes - the toggle action that you are speaking of is the keyboard access to the menu
if you will notice, the "File" menu highlights the first time you press (and release) the ALT key
the next time, it turns off - that is why i am looking at the menu messages

i modified my little program to display message values (as well as hWnd, wParam, lParam)
so - i can trap certain messages and display others, filtering out the ones i do not want to see
that is how i found the menu messages listed above

Hutch -
see my original post   :P

dedndave

on a side-note   :P

i was filtering out unwanted messages
and i thought i would share this little tid-bit
the window proc receives hundreds or thousands of the following messages...

WM_SETCURSOR
WM_CTLCOLORSCROLLBAR
WM_ENTERIDLE
WM_NCHITTEST
WM_NCMOUSEMOVE

had to filter those out just to make sense of the rest of them
i may leave some of them in there - lol

jj2007

Quote from: Tight_Coder_Ex on April 13, 2011, 04:09:17 PM
Quote from: jj2007 on April 13, 2011, 06:24:10 AM
Are you sure it shouldn't be bt eax, 15? And bit eax, 0 for toggled keys?
Although not specifically noted in documentation, experimentation or maybe even an example I saw somewhere showed it was the high order of the byte.  This would make sense as if you were to mask that bit with a boolean operator 16 bit, the instruction would be preceded with 66 whereas bytes and dwords would not.

MSDN:
QuoteReturn Value

Type: SHORT

The return value specifies the status of the specified virtual key, as follows:

    * If the high-order bit is 1, the key is down; otherwise, it is up.
    * If the low-order bit is 1, the key is toggled
The high-order bit of a SHORT is bit 15, or, if you want it even "shorter", bit 7 of ah.
The low-order bit of a SHORT is bit 0 of ax or al.

oex

FYI My middle mouse button doesnt work properly :lol

I say this not only to divert attention from the inevitable doom of the human race but also because I find it somewhat annoying when someone writes a progam and their 'clever' mouse wheely function prevents me from using their application :lol.... I dont know why my mouse middle wheel doesnt work, the button clicks but it doesnt scroll when I wheel it but it's not the first mouse I have had the problem and sometimes mice dont even have middle buttons ::).... This isnt really a bug, more like a mouse trap but if you are writing a sqeeky clean final application you might want an alternative key combo :lol
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

dedndave

if i get it figured out, Peter, you'll be the first to test it for me   :bg
i actually have some time to play with it, tonight

dedndave

it looks like i can reset the mouse wheel step counter upon receiving any of the following and have working code:

WM_SETFOCUS
WM_KEYDOWN
WM_KEYUP
WM_SYSKEYDOWN
WM_SYSKEYUP
WM_ENTERMENULOOP
WM_EXITMENULOOP

i exit via DefWindowProc for these, unless i was to otherwise process them
WM_SYSKEYDOWN and WM_SYSKEYUP require it
and, i imagine it's a good idea for the menu messages for the same reason

dedndave

well - in the end, i decided to forego the ALT-wheel feature
the above works, but it conflicts with the ux guide definition
i got the idea by playing with firefox, i think
i should know that the mozilla guys don't read the ux guide   :P