No numpad recognition on Mac?

For Apple specific issues

No numpad recognition on Mac?

Postby chkn » Sat Aug 28, 2010 5:11 pm

issue #1

Windows: When i press "1" on the left side I get Description "1", on the numpad i get "numpad 1"
Mac: Always get "1"

Code: Select all
bool Editor::keyPressed (const KeyPress& key1, Component* originatingComponent)
{
   DBG("Desc "+key1.getTextDescription());


issue #2
...another issue, i have a workaround, but im wondering if its normal.

result of KeyPress::createFromDescription("W").getKeyCode() is different from when i'm pressing "W" on the keyboard in the keyPressed() callback procedure and call key.getKeyCode();

As a workaround i use "KeyPress newkey=KeyPress::createFromDescription(key.getTextDescription());"


Code: Select all
bool Editor::keyPressed (const KeyPress& key, Component* originatingComponent)
{
   String keyDescription1="W";
   int keyCode1=KeyPress::createFromDescription(keyDescription1).getKeyCode();
   
   int keyCode2=key.getKeyCode();
   String keyDescription2=KeyPress(keyCode2).getTextDescription();
   
   DBG("keyCode1 ="+String(keyCode1)+"  keyDescription1="+keyDescription1);
   DBG("keyCode2 ="+String(keyCode2)+"  keyDescription2="+keyDescription2);




Im Pressing the Key "w" on PC:
Code: Select all
keyCode1 =87  keyDescription1=W
keyCode2 =87  keyDescription2=W


on Mac:
Code: Select all
keyCode1 =87  keyDescription1=W
keyCode2 =119  keyDescription2=W


( i know that keyCode differs on different platforms, but a least createFromDescription should be non-ambiguous?)

PS: i'm using a PC-keyboard on my Mac, don't know if its relevant, maybe someone can cross-check
chkn
JUCE UberWeenie
 
Posts: 884
Joined: Thu Mar 08, 2007 6:17 pm

Re: No numpad recognition on Mac?

Postby jules » Sun Aug 29, 2010 10:01 am

Thanks, I've ironed those things out now - try the tip and see if it helps.
User avatar
jules
Fearless Leader
 
Posts: 17373
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: No numpad recognition on Mac?

Postby chkn » Sun Aug 29, 2010 11:47 am

Thanks, now it works!
chkn
JUCE UberWeenie
 
Posts: 884
Joined: Thu Mar 08, 2007 6:17 pm


Return to MacOSX and iOS

Who is online

Users browsing this forum: Google Feedfetcher and 1 guest