Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 2
  • *Guests: 9
  • *Total: 11

Our Discord

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

Offline RayS

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

Wanted: 737 CDU
by Fabian
[Today at 07:07:59 PM]
Flight Scoring Platforms....
by bernard S
[Today at 05:55:18 PM]
SALE! Airbus A320 trainer, located near Gatwick UK
by nic
[March 21, 2019, 09:35:58 PM]
Help with wiring up FDS map light
by Skysurfer170
[March 21, 2019, 02:36:03 PM]
Complete 737-800 cockpit - moving sale
by navymustang
[March 21, 2019, 09:38:45 AM]
Boeing 737-800 Next Generation Simulator
by blueskydriver
[March 21, 2019, 07:42:41 AM]
Great US switch supplier
by Bob Reed
[March 20, 2019, 09:21:11 PM]
Great video on a Caravelle project
by Lomaric
[March 20, 2019, 06:10:00 PM]
Holy Grail ?
by bernard S
[March 20, 2019, 06:05:06 PM]
Join me on Vatsim Tonight
by Trevor Hale
[March 20, 2019, 09:08:36 AM]
737 MAX
by FredK
[March 19, 2019, 11:07:27 PM]
Sim Speaker System in a small package...
by sagrada737
[March 19, 2019, 01:32:30 PM]
Prosim and RSP TQ interfacing
by jfuenmayor
[March 18, 2019, 02:04:20 PM]
OEM 737 classic liners for sale
by Gallie
[March 18, 2019, 09:54:39 AM]
B737-200 throttle quadrant for sale
by Gallie
[March 18, 2019, 08:56:25 AM]
What have you done for your simulator today?
by 757Simulator
[March 18, 2019, 04:20:49 AM]
JetMax TQ for Sale...
by sagrada737
[March 16, 2019, 02:57:19 PM]
Revolution Simproducts V2.0 Plug & Play Throttle help
by jfuenmayor
[March 14, 2019, 10:13:05 PM]
Attention All Members and Guests
by Trevor Hale
[March 13, 2019, 06:25:07 PM]
Creality CR-10S 3d printer.
by sagrada737
[March 12, 2019, 07:57:11 PM]
CPFlight EFIS737Pro2
by Lomaric
[March 11, 2019, 05:18:20 PM]
Homebuilt seats and a question
by Trevor Hale
[March 11, 2019, 01:32:17 PM]
777 Throttle - sold
by mattking247
[March 10, 2019, 07:13:29 PM]
General Aiation FLIGHT GEAR, For sale
by fairchild
[March 10, 2019, 05:17:41 PM]
I HAD an idea for an inexpensive B737 cockpit - Not so inexpensive now!
by bernard S
[March 10, 2019, 01:03:02 PM]
B737 Heads Up Guidance Systems (HUD)
by navymustang
[March 10, 2019, 12:48:09 PM]
JetMax components for sale - ALL SOLD
by 737SimGuy
[March 08, 2019, 02:41:41 PM]
Open Cockpits P&P MCP/EFIS/FMC for Sale - NEW in USA
by Fabian
[March 07, 2019, 12:21:17 AM]
CPFLIGHT GEAR FOR SALE
by ivanroberts77
[March 06, 2019, 10:46:27 AM]
OEM AFDS Module 737-NG
by Reensel
[March 05, 2019, 03:59:47 PM]