Skip to content

Commit

Permalink
'FIXED: Button Press Events were not added correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
DynamikArray committed Mar 15, 2016
1 parent b041355 commit 58cf67c
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions KISSdata.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local versionInfo = "KISS Telemetry Data - v1.2.1"
local versionInfo = "KISS Telemetry Data - v1.2.2"

local blnMenuMode = 0

Expand Down Expand Up @@ -131,14 +131,25 @@ local function run_func(event)
mahAlertPerc = mahAlertPerc + 1
end

-- Long Presses
if event == 68 then
mahAlertPerc = mahAlertPerc + 1
end

if event == EVT_MINUS_FIRST then
mahAlertPerc = mahAlertPerc - 1
end

-- Long Presses
if event == 69 then
mahAlertPerc = mahAlertPerc - 1
end


lcd.clear()

lcd.drawScreenTitle(versionInfo,2,2)
lcd.drawText(35,10, "Set Percentage Notications")
lcd.drawText(35,10, "Set Percentage Notification")
lcd.drawText(70,20,"Every "..mahAlertPerc.." %",MIDSIZE)
lcd.drawText(66, 35, "Use +/- to change",SMLSIZE)

Expand All @@ -153,13 +164,22 @@ local function run_func(event)

-- Respond to user KeyPresses for mahSetup
if event == EVT_PLUS_FIRST then
mahTarget = mahTarget + 10
mahTarget = mahTarget + 1
end

if event == 68 then
mahTarget = mahTarget + 1
end

if event == EVT_MINUS_FIRST then
mahTarget = mahTarget - 10
mahTarget = mahTarget - 1
end

if event == 69 then
mahTarget = mahTarget - 1
end


--Update our screen
lcd.clear()

Expand Down

0 comments on commit 58cf67c

Please sign in to comment.