Editor: Map Options Editbox Keyboard Input

Bug #791421 reported by Astuur on 2011-06-01
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Low
Unassigned

Bug Description

The Edit box in the Editor's "Map Options" does accept cursor, (enter) and delete keys ect. from the main keyboard,
but not their numlocked equivalents from the numeric block.
Edit: Enter (Return) keys both do work!
Also, would it not be clearer, if there was a "save" and "cancel" button on exiting this box? (split out to bug 814500)

Related branches

Hans Joachim Desserud (hjd) wrote :

Sounds strange. I would assume those keys sent the same signals as the others. I haven't been able to check though, since my keyboard does not have a numeric block (laptop).

Save/cancel buttons sounds like a good idea, but please file a separate report.

Changed in widelands:
importance: Undecided → Low
tags: added: editor
Astuur (wolfsteinmetz) wrote :

Hope that isn't due to my keyboard after all.
I have an +15 years old ergonomic Cherry keyboad with a cabled numeric block - so who knows.
Could somebody please check with a modern standard keyboard?
Else please set to invalid.

Hans Joachim Desserud (hjd) wrote :

Just remembered one thing you could try. If you are on a GNU/Linux-based operating system* you can open a terminal and run the program xev . Then when you press the keys or in other ways interact with the system, it will display the information it receives. Possibly you can use it to see if the same information is printed for both keys.

I don't know the details, but I suspect if the other enter-key doesn't send the same signal as an enter-key it will not be registered as such, and it will be ignored just as if you pressed another key which does nothing.

*I'm afraid I don't know how to do this if you are using windows or Mac OS X. Perhaps someone else does?

Astuur (wolfsteinmetz) wrote :

I'm on Win32 unfortunately.
But I had access meanwhile to a different Win32 machine.

I must correct myself: Both Enter and Return do work!
(with my own keyboard also)

What I said is true for the cursor keys and for the delete key.
The toggle Insert/Typeover does not work with either key.
IIt's no big thing if you know, but puzzling if you don't.

Astuur (wolfsteinmetz) on 2011-07-22
description: updated
description: updated
Borim (borim) wrote :

@hjd the xev hint is helpful

the key codes are different for the "normal" keys and the numeric block ones.
an example: enter sends: 0xff0d (Return) and numeric block enter sends: 0xff8d (KP_Enter)

Borim (borim) wrote :

i tracked down where the different keys are handled and add the numpad keys to the different handlers.

the attached patch (np_key.patch) contain all changes

Hans Joachim Desserud (hjd) wrote :

Hi Borim, thanks for your patch.

Launchpad has a built-in system for code review of suggested patches. This makes it easier to review the changes and post comments than when dealing with .patch-files. Would you be willing to push a branch with your changes and create a merge proposal?

See https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair and https://help.launchpad.net/Code/UploadingABranch for how to do this. After successfully uploading a branch, click on the button "propose for merging". :)

Borim (borim) wrote :

sure, if this is the preferred way.

Astuur (wolfsteinmetz) wrote :

Thanks Borim for this patch.
Would it also cover the same kind of problems with the keypad key in the message window (del) and
the numpad PgUp/PgDn keys that do not work, or is it strictly for the edit box input ?
I have not collected these things, but I have a feeling that there are more incidents of this problem game-wide.

Borim (borim) wrote :

the branch from me assign the np keys for:
* PgUp / PgDown (acceleration control)
* Home (jump to headquarter)
* arrow keys (move map and cursor in edit box)
* the edit box delete key

so this does not only affect the edit box input. I am a little bit unsure what you mean with PgUp/PgDown not working. If you mean that you can not use the numpad PgXXX keys, than yes this is fixed.

BUT not for deleting the message!
as another numpad key was defined for deleting the message. Thats why I created a new bug report:
https://bugs.launchpad.net/widelands/+bug/864184

Astuur (wolfsteinmetz) wrote :

Yes, I meant the Numpad Pgxx not being usable for acceleration control - sorry should have been clearer.
It seems you have covered everything I can currently think of - great.
gain my thanks!

SirVer (sirver) wrote :

Merged in r6006. I added you as "Borim (borim)" to the lists of developers. If you want to appear under a different name/id, please contact me via PM either here on launchpad or on widelands.org. Thanks for the contribution!

Changed in widelands:
milestone: none → build17-rc1
status: New → Fix Committed
Shevonar (shevonar) wrote :

I'm not sure if this is actually intended but you could no longer use the numeric keypad keys to write numbers. I think the user should be able to switch between number and "arrow"/function mode by using the numlock key. I fixed this in revision 6038.

SirVer (sirver) wrote :

Released in build17-rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers