Way to differentiate Enter and Return Keys


Is there a way to differentiate the Enter key (the one in the keypad) and return Key (the other one)?


For my machine, the character is different.

[code] else if(key.isKeyCode (KeyPress::returnKey))
cout << "keycode " << key.getKeyCode() << " char " << key.getTextCharacter() << endl;


Not sure if this can be used cross-platform.

Jules ?

Checking the text character might actually work ok, but it’s not something that’s guaranteed to be cross-platform.


Can you add another keyCode to distinguish these. I see several posts wanting to use enter and return as separate key strokes?

Hmm. It's a sensible request, but the trouble is that if I move the enter key events to a new value, then existing code which expects to detect both return + enter will stop working with the enter key.

Again I'll ask this and I am sure many others would use it. For the case where others are testing for just return, it is simple to add the test for enter.  Yes they migh not catch it immediately, but eventually they will and most use return anyway.

Everytime I update juce I spend at least a day redoing my code that doesn't compile or work, so the argument against implementing it is not a strong one.

No, my argument against doing this is a very strong one..

Changes that trigger compile errors may be annoying, but they're safe because they let you know when something has changed and you can update your code appropriately. But changing something that causes the user's program behaviour to silently change without them knowing is really NOT ok, and that's what would happen if I changed this.

Ok, how about being able to set a juce flag that allows both.

Oh I don't know. How about if it was made to reliably return a different text character for the different keys?