Skip to content

Commit

Permalink
chore: update example
Browse files Browse the repository at this point in the history
  • Loading branch information
true_mogician committed Feb 23, 2021
1 parent dfde759 commit bc5b859
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/test/test.lua → src/test/example.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ require "src/test/test framework"
require "src/key combination"

local auxilary = { count = 0 }
CombinedEventHandler:AddSpecialHandler(
function (self, event, btn, pressed)
print("pressed : " .. pressed, "count : " .. self.Auxiliary.count, "btn : " .. btn)
KeyCombination:AddPostHandler(
function (self, event, button, pressed)
if event == "press" then
self.Auxiliary.count = self.Auxiliary.count + 1
self.Instrument.count = self.Instrument.count + 1
elseif event == "release" then
self.Auxiliary.count = self.Auxiliary.count - 1
self.Instrument.count = self.Instrument.count - 1
if self.Instrument.count == 0 then
print()
end
end
end,
auxilary
Expand Down
16 changes: 16 additions & 0 deletions src/test/operations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,20 @@ p Primary
p Secondary
r Primary
r Secondary
p SideMiddle
p Primary
r SideMiddle
r Primary
p SideBack
p Primary
p Secondary
r Primary
r SideBack
r Secondary
p SideBack
p Secondary
p Primary
r Primary
r Secondary
r SideBack
deactive

0 comments on commit bc5b859

Please sign in to comment.