Skip to content

Commit

Permalink
Updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dokutan committed Dec 26, 2021
1 parent 6cb87b4 commit bce363d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/example.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ function input_handler( event )

-- execute commands
if event[2] == 58 then -- this won't work
os.execute( "mpc toggle" )
os.execute( "mpc toggle &" )
end

if event[2] == "58" then -- this does
os.execute( "mpc toggle" ) -- F1
os.execute( "mpc toggle &" ) -- F1
end
if event[2] == "59" then
os.execute( "mpc prev" ) -- F2
os.execute( "mpc prev &" ) -- F2
end
if event[2] == "60" then
os.execute( "mpc next" ) -- F3
os.execute( "mpc next &" ) -- F3
end

-- when this function returns "quit", the device gets closed
Expand Down
1 change: 1 addition & 0 deletions examples/single_macros.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ settings = {

-- Edit this table to configure the macros.
-- Functions get called, strings passed to os.execute().
-- It is strongly recommended to add "&" to the end of commands to prevent blocking.
keymap = {
["down:KEY_ESC"] = macrodevice.close, -- request closing all opened devices
["down:KEY_A"] = "echo 'pressed a'",
Expand Down

0 comments on commit bce363d

Please sign in to comment.