Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 3
  • *Guests: 45
  • *Total: 48

Our Discord

Author Topic: LUA First question: Keyboard events....  (Read 1181 times)

Offline RayS

  • I spend way too much on this forum!
  • *
  • Posts: 795
  • Private Pilot, Sim Enthusiast
    • Anthony Scott Photography
  • First Name: Ray Sotkiewicz
  • Home Location: Seattle, WA
LUA First question: Keyboard events....
« on: November 20, 2015, 03:54:20 PM »
This is more abstract and deals with functionality.

I downloaded the SimInnovation gauge suite and it's all based on LUA programming.

Does LUA have a library/facility to work with keyboard events? I see facilities for Joystick events which has me thinking. With regard to rotary encoders, they need to be spun with some vigor sometimes. My concern is that if the rotaries use joystick events, that the overall joystick architecture will end up missing a lot of those button events, while my experience has shown that working with keyboard events is a lot cleaner.

Can anyone share their experiences?
Ray Sotkiewicz

Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,727
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Re: LUA First question: Keyboard events....
« Reply #1 on: November 20, 2015, 06:28:46 PM »
Ray,

Lua itself does not natively accept inputs. But like arduino there are library's you can import.

Take a look at the io library, which by default has standard-input as the default input file:

http://www.lua.org/pil/21.1.html

Quote
local answer
repeat
   io.write("continue with this operation (y/n)? ")
   io.flush()
   answer=io.read()
until answer=="y" or answer=="n"

Trev

Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

 

FlightSimExpo 2019

FsExpo

Recent Posts

Wrong hiegth above ground when landing and P3D set for Panel Only
by navymustang
[Today at 08:30:23 AM]
12v power supply for map light
by Joe Lavery
[Today at 07:45:52 AM]
Windscreen/windshield Wipers
by blueskydriver
[Today at 03:32:37 AM]
B767 MIP
by Goodenough
[January 16, 2019, 09:13:23 PM]
STEERING AND YOKE 737 PROMO
by blueskydriver
[January 16, 2019, 06:07:16 PM]
Join me on Vatsim Tonight
by Trevor Hale
[January 16, 2019, 05:53:50 PM]
YOU CAN HELP SHAPE FLIGHTSIMEXPO: 2020
by Trevor Hale
[January 16, 2019, 01:10:08 PM]
Streaming with Elgato tools.
by RayS
[January 15, 2019, 03:43:59 PM]
Help in building a GTN 650/750 for Reality XP
by redman
[January 14, 2019, 01:02:57 PM]
What have you done for your simulator today?
by bernard S
[January 14, 2019, 12:05:01 PM]
Complete 737-800 cockpit - moving sale
by navymustang
[January 14, 2019, 11:07:28 AM]
Wanted: B737 Linked Yoke,
by dvst8r
[January 14, 2019, 10:55:31 AM]
Replace display Flyengravity CDU
by flymo
[January 13, 2019, 01:10:55 PM]
It's been a while. a new picture of my baby!
by Trevor Hale
[January 13, 2019, 09:21:19 AM]
Mickey's Flightdeck - A Boeing 737-800 Cockpit on Youtube
by blueskydriver
[January 13, 2019, 08:25:21 AM]
Three Projector 210 degree with P3D4
by blueskydriver
[January 10, 2019, 04:12:26 AM]
Aircraft Registration Placard
by jackpilot
[January 07, 2019, 10:19:13 AM]
How do you manage power amperage for your sim
by kurt-olsson
[January 07, 2019, 10:12:23 AM]
Trim Wheels
by Joe Lavery
[January 07, 2019, 04:18:15 AM]
ActiveSky - across networked PCs anyone
by FredK
[January 06, 2019, 10:54:28 PM]
ACE 737 Pro Yoke stab trim switch issue help needed
by dornier
[January 06, 2019, 08:23:42 PM]
Help In wiring LED and Fan
by GyverX
[January 06, 2019, 03:54:28 PM]
737-800 Arduino X-Plane Build
by kurt-olsson
[January 06, 2019, 11:38:46 AM]
B737 OEM Throttle Quadrant and more to come
by archen
[January 05, 2019, 06:27:11 PM]
Wanted: 737 FMC/CDU
by blueskydriver
[January 04, 2019, 07:35:04 PM]
Other forums ?
by navymustang
[January 03, 2019, 05:51:20 PM]
FLIGHTSIMEXPO LAUNCHES DISCOUNTED ADVANCE REGISTRATION FOR ORLANDO 2019 EVENT
by Slacker
[January 03, 2019, 09:52:14 AM]