Closed
Bug 238264
Opened 21 years ago
Closed 21 years ago
Mozilla doesn't use GetKeyState according to spec
Categories
(Core Graveyard :: GFX: Win32, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: neil, Assigned: neil)
Details
Attachments
(1 file)
1.22 KB,
patch
|
emaijala+moz
:
review+
rbs
:
superreview+
asa
:
approval1.7+
|
Details | Diff | Splinter Review |
The MSDN docs state that on Windows the sign bit 15 of the 16-bit short return
value from GetKeyState determines the pressed state of the key. However Mozilla
uses bit 7 for some reason.
Assignee | ||
Comment 1•21 years ago
|
||
Assignee: win32 → neil.parkwaycc.co.uk
Status: NEW → ASSIGNED
Assignee | ||
Updated•21 years ago
|
Attachment #144506 -
Flags: review?(ere)
Assignee | ||
Comment 2•21 years ago
|
||
http://lxr.mozilla.org/seamonkey/source/embedding/tests/mfcembed/BrowserView.cpp#458
doesn't look right either but I'll let Adam figure out what he wants there...
Comment 3•21 years ago
|
||
Comment on attachment 144506 [details] [diff] [review]
Proposed patch
I've seen a few examples where 0x80 is used (such as
http://mech.math.msu.su/~vfnik/WinApi/g/getkeystate.html). I'm not sure why,
but it's definitely wrong according to any recent documentation. Anyway, better
to do it right. r=ere
Attachment #144506 -
Flags: review?(ere) → review+
Assignee | ||
Updated•21 years ago
|
Attachment #144506 -
Flags: superreview?(rbs)
Comment on attachment 144506 [details] [diff] [review]
Proposed patch
sr=rbs
Apparently the confusion is because people think that 'short' is 8 bit, whereas
it is 16 bit instead, and they meant to test 0x8000.
I checked another MSDN document which stated clearly that:
"The GetKeyState() function returns a number indicating the current state of a
specific key at the time the DLL call is made. A negative number indicates that
the key is pressed, a positive number indicates that the key is not pressed."
Attachment #144506 -
Flags: superreview?(rbs) → superreview+
Assignee | ||
Comment 5•21 years ago
|
||
Comment on attachment 144506 [details] [diff] [review]
Proposed patch
Seeking approval for this low-risk Windows-specific correctness patch.
Attachment #144506 -
Flags: approval1.7?
Assignee | ||
Comment 6•21 years ago
|
||
Hmm... it looks like that quote comes from KB article 108357.
Comment 7•21 years ago
|
||
Comment on attachment 144506 [details] [diff] [review]
Proposed patch
a=asa (on behalf of drivers) for checkin to 1.7
Attachment #144506 -
Flags: approval1.7? → approval1.7+
Assignee | ||
Comment 8•21 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Cool. Every time I looked at that code I thought that it couldn't be right.
Updated•16 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•