Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 0
  • *Guests: 58
  • *Total: 58

Our Discord

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

Offline RayS

  • I spend way too much on this forum!
  • *
  • Posts: 815
  • 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,832
    • 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

What have you done for your simulator today?
by blueskydriver
[Today at 07:28:19 PM]
GSX across networked client visual computers
by zillmer
[Today at 05:38:53 PM]
Jetmax TQ - motorized it?
by FredK
[Today at 07:58:36 AM]
Mickey's Flightdeck - A Boeing 737-800 Cockpit on Youtube
by Extraterra
[Today at 02:47:37 AM]
FDS CDU old
by kattz
[May 19, 2019, 01:13:46 PM]
Serial Key
by hiflight1
[May 19, 2019, 05:10:00 AM]
Join me on Vatsim Tonight
by Trevor Hale
[May 15, 2019, 01:58:50 PM]
Gauge circuit
by jackpilot
[May 15, 2019, 01:56:51 PM]
Prosim and RSP TQ interfacing
by jfuenmayor
[May 15, 2019, 08:53:22 AM]
Arduino Mega question Newbie
by Yair1956
[May 15, 2019, 02:23:57 AM]
f18 mfd
by bernard S
[May 14, 2019, 11:15:44 PM]
Multi-Projector color calibration
by fsaviator
[May 13, 2019, 04:32:23 PM]
Immersive Calibration Pro help?
by jskibo
[May 13, 2019, 09:22:00 AM]
X-Plane 737-800 Build
by kenrosefire
[May 12, 2019, 08:37:05 PM]
KBD03 Keyboard Emulator
by Yair1956
[May 12, 2019, 03:52:05 PM]
5 Position Rotary Spring return Switch
by Yair1956
[May 12, 2019, 03:09:25 PM]
Flyengravity desktop MIP
by patiju
[May 11, 2019, 05:11:05 PM]
Pfd display.
by Patt737
[May 08, 2019, 12:48:32 PM]
Mini Sim
by jskibo
[May 08, 2019, 08:36:28 AM]
F16 Simulator For Sale
by blueskydriver
[May 08, 2019, 12:14:40 AM]
Wanted: Collins Style radios
by jkbarr30
[May 07, 2019, 08:23:32 PM]
Crap! 26V on 5V backlight!
by Steenos
[May 07, 2019, 05:33:46 PM]
Complete 737-800 cockpit - moving sale
by Ed
[May 07, 2019, 08:01:22 AM]
Prosim 737 iOS help
by Aztrucker
[May 06, 2019, 11:56:30 PM]
Fly Elise Warping
by jskibo
[May 06, 2019, 11:14:31 AM]
CPFlight 737 NG MCP Pro and Efis Pro (SOLD)
by patiju
[May 05, 2019, 10:52:46 AM]
Operating System Blues
by 727737Nut
[May 03, 2019, 11:54:35 AM]
FOR SALE - 737 Sim items
by flymo
[May 02, 2019, 07:43:53 AM]
Cpflight MCP737PRO (SOLD)
by archen
[April 30, 2019, 02:07:33 PM]
737-800 Arduino X-Plane Build
by Trevor Hale
[April 29, 2019, 07:29:12 PM]