Board index FlightGear Development

Keyboard bindings: limited distinction of Num-Pad keys

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Keyboard bindings: limited distinction of Num-Pad keys

Postby mhab » Fri Oct 18, 2013 6:45 am

Hello

Having dug into FG now for a while I found my way through many things ...
I value the flexibility that is offered in possible key-bindings which allows a lot more flexibilty than in other sims ...

A.F.A.I.K as of FG 2.12 there is no comfortable graphic dialog which allows to change existing keyboard assignments, and so I went the hard way to configure/program what I was looking for.
I learned how to manipulate the "keyboard.xml" file and how to use the bindings.

There seems to be a limitation however, which limits some aspects of using keyboard assignments to full extent.
The problem I couldn't solve is that keys of the Num-Pad (Numeric Keypad block) cannot be distinguished from other keys on a usual full sized e.g. 104-key keyboard.
FG-manual even talks about that Num-Lock needs to be active in order to use it for flight-control.

What I intend to do is to keep the assigments of the Num-Pad for Flight control like, aileron/elevator, throttle (for those who prefer to fly without a mouse or joystick :roll: )
But what I would really like to do, and it seems to be not possible for now, is to use e.g. the extra arrow key block , the Home/End,PgUp/PgDwn,Ins/Del block beside the Num-Pad block independently of the Num-Pad assignments.

What I did is:
I went along to use the following line from "keyboard.xml" in order to find the keycode for the keys I intend to use:
setlistener("devices/status/keyboard/event", func(n) debug.dump(n.getValues()));

In this way I cannot get any distinction between the Num-Pad keys and the above mentioned keys in the arrow-key block etc.

Is this a limitation in FG core or did I miss out on something ?

Thanks
Mike-DE
mhab
 
Posts: 410
Joined: Thu Apr 18, 2013 10:59 pm
Callsign: D-MIKE
Version: 2019.1.1
OS: Win10

Re: Keyboard bindings: limited distinction of Num-Pad keys

Postby zakalawe » Fri Oct 18, 2013 9:20 am

Unfortunately this is a limitation of how we map keys, which is partly historical from when we used to use GLUT, and the ASCII mappings of the keys. Really we should move towards using symbolic names for the keys, but this is some work and would likely break things for people who already customised their keyboard.xml file. So it's a difficult problem to solve.
zakalawe
 
Posts: 1152
Joined: Sat Jul 19, 2008 4:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: Keyboard bindings: limited distinction of Num-Pad keys

Postby mhab » Fri Oct 18, 2013 2:19 pm

Hello

OK, thanks for the explanation. I understand the compatibilty issue and the bigger picture of having symbolic names.
Couldn't it be an intermediate improvement to just return new codes (such codes which were not used up to now) for additional keys ?

If the keys in the extra blocks (arrows, ins/del,....) would get new keys and all other keys return codes as usual it would open up the usabilty of the new keys and break nothing already used.

B.T.W.: It may be more consistent to issue an enhancement request, if this is a FG core issue ...
Let me know if this is desirable and I can do that.

Mike-DE
mhab
 
Posts: 410
Joined: Thu Apr 18, 2013 10:59 pm
Callsign: D-MIKE
Version: 2019.1.1
OS: Win10


Return to Development

Who is online

Users browsing this forum: amue and 1 guest