Key Identifiers

Announcements, questions
Post Reply
seanbradley
Posts: 1
Joined: 06 Apr 2016, 16:33

Key Identifiers

Post by seanbradley » 06 Apr 2016, 21:51

In LMC.LUA Line 50

commands2[192]='sim/view/still_spot' -- 192 is vkey code of '`'

and then line 52

commands2[string.byte('1')]='SRS/X-Camera/Select_View_ID_1'


Is it safe to assume that you can either use the key code or the string.byte(" ` ") interchangeably?

The second question is what is in line 50 what is the sim/view doing?

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Key Identifiers

Post by admin » 07 Apr 2016, 08:04

string.byte return ASCII code of the character - better for readability. The 192 means I just wrote the code directly, probably copying from debug log. I have this value as key in Lua table and use key code received by keyboard handler to search it (line 130). No doesn't matter if I enter the code directly or use string.byte.

sim/view/still_spot is command that I send to Xplane to change current view - same thing as if I choose from menu
Petr Medek
LUAmacros author

Post Reply