Mac Numeric Keypad: /,*.-.+ and Enter keys do not work

This question was asked previously, however, there was no resolution.
These keys work fine from the regular Mac keyboard, and the numeric keys work fine on the keypad.

Most problematic for my app, the Enter key does not work, so the keypad is rather useless.

I am currently looking for the following keycodes:

WXK_RETURN

WXK_NUMPAD_ENTER

However, perhaps there is some other key code returned.

Unfortunately, my Mac does not have keypad.

Could someone with a Mac numeric keypad to run the attached code and post what codes actually get returned when you press /,*.-.+ and Enter on the Mac’s numeric keypad?

Thanks.

KeyCode.py (745 Bytes)

I’m not sure but I placed a bit of a hack in my code when I did test my app on a mac also. Basically, all I did was remove the numpad enter from my code if running on mac.
Fortunately the most of my numpad related code doesn’t use the numpad enter, but in regular/basic usage it does not exist, which is bad for auditors.
@ Robin: This does need a fix or whatever hooked in.
Yes, this does render the numpad almost completely useless.

elif IMAWXMAC: # TODO(priority=9) ~wx.WXK_NUMPAD_ENTER not recognised~
if wx.GetKeyState(wx.WXK_RETURN): # wx.GetKeyState(wx.WXK_NUMPAD_ENTER) or
elif not IMAWXMAC:
if wx.GetKeyState(wx.WXK_NUMPAD_ENTER) or wx.GetKeyState(wx.WXK_RETURN):

IIRC there was another issue with MenuItems with an ID of zero (0) that caused complaints also. Avoid these for the most part, even as seperators. Reading from a xml is probably OK if handled inbetween in the code tho.

Just to clarify, you don’t get a wx.WXK_NUMPAD_ENTER on the Mac when the numeric keypad Enter is pressed.

You don’t get wx.WXK_NUMPAD_MULTIPLY, wx.WXK_NUMPAD_DIVIDE, wx.WXK_NUMPAD_EQUAL, wx.WXK_NUMPAD_ADD or wx.WXK_NUMPAD_SUBTRACT when those keys are pressed either.

Do you get some other codes?

I was hoping that someone with a Mac and a numeric keypad could run the attached code and tell me what there were.

I would do it myself, but my Mac does not have a numeric keypad.

It would be great to fix the bug in wxPython, or perhaps in wx.

However, hardcoding the return codes would be acceptable to me right now.

I have a user that can’t use his numeric keypad with numeric intensive input - I need a solution!

···

On Friday, December 6, 2013 3:16:30 PM UTC-5, Metallicow wrote:

I’m not sure but I placed a bit of a hack in my code when I did test my app on a mac also. Basically, all I did was remove the numpad enter from my code if running on mac.
Fortunately the most of my numpad related code doesn’t use the numpad enter, but in regular/basic usage it does not exist, which is bad for auditors.
@ Robin: This does need a fix or whatever hooked in.
Yes, this does render the numpad almost completely useless.

elif IMAWXMAC: # TODO(priority=9) ~wx.WXK_NUMPAD_ENTER not recognised~
if wx.GetKeyState(wx.WXK_RETURN): # wx.GetKeyState(wx.WXK_NUMPAD_ENTER) or
elif not IMAWXMAC:
if wx.GetKeyState(wx.WXK_NUMPAD_ENTER) or wx.GetKeyState(wx.WXK_RETURN):

IIRC there was another issue with MenuItems with an ID of zero (0) that caused complaints also. Avoid these for the most part, even as seperators. Reading from a xml is probably OK if handled inbetween in the code tho.

1: keycode=47 for /

2: keycode=42 for *

3: keycode=45 for -

4: keycode=43 for +

5: keycode=13 for enter

6: keycode=61 for =

nothing for clear

HTH

MarkL

···

On 8 December 2013 22:38, Edward Sitarski edward.sitarski@gmail.com wrote:

Just to clarify, you don’t get a wx.WXK_NUMPAD_ENTER on the Mac when the numeric keypad Enter is pressed.

You don’t get wx.WXK_NUMPAD_MULTIPLY, wx.WXK_NUMPAD_DIVIDE, wx.WXK_NUMPAD_EQUAL, wx.WXK_NUMPAD_ADD or wx.WXK_NUMPAD_SUBTRACT when those keys are pressed either.

Do you get some other codes?

I was hoping that someone with a Mac and a numeric keypad could run the attached code and tell me what there were.

I would do it myself, but my Mac does not have a numeric keypad.

It would be great to fix the bug in wxPython, or perhaps in wx.

However, hardcoding the return codes would be acceptable to me right now.

I have a user that can’t use his numeric keypad with numeric intensive input - I need a solution!

On Friday, December 6, 2013 3:16:30 PM UTC-5, Metallicow wrote:

I’m not sure but I placed a bit of a hack in my code when I did test my app on a mac also. Basically, all I did was remove the numpad enter from my code if running on mac.
Fortunately the most of my numpad related code doesn’t use the numpad enter, but in regular/basic usage it does not exist, which is bad for auditors.

@ Robin: This does need a fix or whatever hooked in.
Yes, this does render the numpad almost completely useless.

elif IMAWXMAC: # TODO(priority=9) ~wx.WXK_NUMPAD_ENTER not recognised~
if wx.GetKeyState(wx.WXK_RETURN): # wx.GetKeyState(wx.WXK_NUMPAD_ENTER) or
elif not IMAWXMAC:
if wx.GetKeyState(wx.WXK_NUMPAD_ENTER) or wx.GetKeyState(wx.WXK_RETURN):

IIRC there was another issue with MenuItems with an ID of zero (0) that caused complaints also. Avoid these for the most part, even as seperators. Reading from a xml is probably OK if handled inbetween in the code tho.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

1: keycode=47 for /

2: keycode=42 for *

3: keycode=45 for -

4: keycode=43 for +

5: keycode=13 for enter

6: keycode=61 for =

nothing for clear

HTH

MarkL

OK, so what I’m thinking is check at the beginning of the file for mac and then add them to wx namespace such as…

if wx.Platform == ‘WXMAC’:
wx.WXK_NUMPAD_ENTER = 13
wx.WXK_NUMPAD_MULTIPLY = 42
wx.WXK_NUMPAD_DIVIDE = 47
wx.WXK_NUMPAD_EQUAL = 61
wx.WXK_NUMPAD_ADD = 43
wx.WXK_NUMPAD_SUBTRACT = 45

I guess this code should work even on a “hackintosh”, which often doesn’t have or run on mac hardware anyway.
What about the NUMPAD Clear/ (decimal(.)/del) key on windows…

···

On Sunday, December 8, 2013 8:12:14 PM UTC-6, Mark Livingstone wrote:

It’s been a while, but it’s been a while since I’ve had a few minutes at my Mac with a full keyboard… I hope this is still useful:

/

60: keycode=392

61: keycode=47

···

On Fri, Dec 6, 2013 at 8:03 AM, Edward Sitarski edward.sitarski@gmail.com wrote:

This question was asked previously, however, there was no resolution.
These keys work fine from the regular Mac keyboard, and the numeric keys work fine on the keypad.

Most problematic for my app, the Enter key does not work, so the keypad is rather useless.

I am currently looking for the following keycodes:

WXK_RETURN

WXK_NUMPAD_ENTER

However, perhaps there is some other key code returned.

Unfortunately, my Mac does not have keypad.

Could someone with a Mac numeric keypad to run the attached code and post what codes actually get returned when you press /,*.-.+ and Enter on the Mac’s numeric keypad?

Thanks.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax

Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov