Thursday, November 30, 2006

Keyboard Mapping - seemed like a good idea at the time

X-Plane 860 introduces a fundamental change in the way the keyboard is handled in X-Plane.

Before X-Plane 860, keyboard keys are matched to their commands by looking at the character that is prodcued by typing.

For example, spot view is produced by the '@' symbol. On a US keyboard that means shift-2. On an Italian keyboard, the @ symbol is shift + the ò key (ò on its own key, cool!).

But in X-Plane 860, the matching is done on the key itself, not the symbol you get when typing. In other words, the 2 key is the 2 key no matter what. So in X-plane 860, spot view is mapped to shift-2 and shift-2 will induce spot mode whether this gives you @ or " when typing (on Italian keyboards, shift-2 gives the double-qoute).

One advantage of this method is that the keys stay in roughly the same place...the point of those strange punctuation keys for autopilot modes is that on a US keyboard they're all top-of-the-keyboard functions. Now that the keyboard bindings are based on the number keys plus the shift key, this will be true on international keyboards too.

One disadvantage of the new system is that if there is no "primary" key for a symbol, international keyboards can't use it. For example, ; is a key on a US keyboard, but is made by shifiting the , key on an Italian keyboard. So right now in beta 2 Italians can't invoke free-view (ctrl-;) at all...if they type ctrl-shift-, they get, well, ctrl-shift-,. (Of coures, mapping free view to ctrl-shift-, in the keys file does work.)

For now please just keep in mind that 860 is a beta and is still a work in progress. In the long term once we get the quirks worked out, the new keyboard system offers a lot more mapping combinations, because everything can be mapped with any combination of modifier keys. No more running out of keyboard combinations!

Also for hackers, try X-Plane --cmnds=all to see a list of all possible command bindings in the sim.


Anonymous said...

thanks a lot for that information. Will the changes in 8.60 also make keyboards better work in the linux version?

Until now, i.e. I cannot zoom out since x-plane always reports that the pressed key is not recognized or some error like that

Anonymous said...

Ben, how the --cmnds=all switch should exactly work? I see no output in dos prompt, nor useful info in the logs.



Benjamin Supnik said...

You'll need to use | more to pipe output to more ... console output in Windows doesn't work due to the nature of the DOS prompt. :-( This is covered in more detail in the blog article on cmnd-line options.

Anonymous said...

Got it. I did it with --cmnds=all | more > cmdlist.txt