PDA

View Full Version : Numpad enter key patch



spin
01-09-2011, 01:27 PM
Hello,

today, I noticed that GUI components like e.g. LineEdit do not accept enter presses from the numpad enter key. (This might be the case only on Linux machines). I used this issue to dive a little into the code and created a patch, so that the numpad enter key has the same effect as the "normal" enter key.

As I use only Linux, I did not test this on Windows or OS X (I don't even know if they already accept numpad enter). I did, however, create the numpad enter constant for them as well and just set it to CL_KEY_RETURN, so that the build is not broken and the behaviour should stay the same.

If you have a Windows or OS X machine, it would be great if you could add the correct key codes to the patch.

Cheers,
spin

rombust
01-09-2011, 03:13 PM
Heh, I am surprised that has not been noticed many years ago

Although, the most flexibile. I am not sure if it is the best way.

Looking at: http://en.wikipedia.org/wiki/Enter_key#Differences_between_Enter_and_Return

Return and Enter may or may not be the same key.

So, strickly speaking the patch is correct.

But, on microsoft windows, there is no virtual key to distinguish between enter and return

Maybe hardcode the linux target so the Enter key is always the return code.

I do not know

What do other developers think?

rombust
01-09-2011, 07:56 PM
Thinking about it, I prefer to accept the patch

sphair
01-09-2011, 10:21 PM
Cross platform consistency is more important than more-features-on-one-platform IMO, so I agree :)

rombust
01-10-2011, 01:22 PM
Okay.

Patch applied to ClanLib 2.2 and 2.3 SVN

Many thanks