Opened 8 years ago

Closed 18 months ago

#3458 closed defect (fixed)

GetUnicodeKey() for WXK_DELETE should return 127, not 0

Reported by: joergrichter Owned by:
Priority: low Milestone:
Component: wxMSW Version: stable-latest
Keywords: key event inconsistency Cc: joergrichter, hockkn
Blocked By: Blocking:
Patch: yes

Description

wxMSW, 2.6.3

I have a keydown event handler for a wxTextCtrl.
Pressing the DELETE key produces a key down event with
GetKeyCode() == 127 and GetUnicodeKey() == 46

wxGTK returns both 127

Attachments (1)

3458.patch download (463 bytes) - added by oneeyeman 18 months ago.
Patch that fixes the problem

Download all attachments as: .zip

Change History (5)

comment:1 Changed 22 months ago by oneeyeman

This is what keyboard sample produces for me (TRUNK):

Hook DELETE 127 ----52428 (U+cccc) 46 0x01530001 ( 477, 125)

KeyDown DELETE 127 ---- 0 (U+0000) 46 0x01530001 ( 477, 125)

Char DELETE 127 ---- 0 (U+0000) 46 0x01530001 ( 477, 125)

Tested on Windows 7 64-bit + MSVC 2010.

comment:2 Changed 22 months ago by vadz

  • Keywords key event inconsistency added
  • Priority changed from normal to low
  • Status changed from new to confirmed
  • Summary changed from GetUnicodeKey for WXK_DELETE returns 46 to GetUnicodeKey() for WXK_DELETE should return 127, not 0
  • Version set to 2.9-svn

There is still a discrepancy with wxGTK here: Unicode key code is 127 in wxGTK but 0 in wxMSW. I guess it should be 127 in wxMSW too, after all this is a valid Unicode key code.

Changed 18 months ago by oneeyeman

Patch that fixes the problem

comment:3 Changed 18 months ago by oneeyeman

  • Patch set

Attached please find a patch that solves the issue.

comment:4 Changed 18 months ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [73718]) Use WXK_DELETE as Unicode key code for VK_DELETE in wxMSW.

U+007F is a Unicode character so we should set Unicode key code to this value
for VK_DELETE presses. This also makes wxMSW consistent with wxGTK.

Closes #3458.

Note: See TracTickets for help on using tickets.