Skip to content

Commit

Permalink
finish
Browse files Browse the repository at this point in the history
  • Loading branch information
myrrc committed Jul 11, 2024
1 parent dcce886 commit fc967a6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
5 changes: 3 additions & 2 deletions Scripts/install-reaper-keys.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- @description reaper-keys: map keystroke combinations to actions like in vim
-- @version 2.0.0-a2
-- @version 2.0.0-a3
-- @author gwatcha
-- @links
-- GitHub repository https://github.com/gwatcha/reaper-keys
Expand Down Expand Up @@ -115,7 +115,8 @@ local keymap = io.open(keymap_path, "w")
if not keymap then return reaper.MB("Failed to create " .. keymap_path, "Error", 0) end

function KEY(mod_id, key_id, command_id, section_id)
return ("KEY %d %d %s %d\n"):format(mod_id, key_id, command_id, section_id)
return ("KEY %d %d %s %d\nKEY %d %d 101 102\n"):format(
mod_id, key_id, command_id, section_id, mod_id, key_id)
end

local parent_dir = debug.getinfo(1, "S").source:match "@?(.*)[\\/].*[\\/]"
Expand Down
50 changes: 24 additions & 26 deletions internal/gui/feedback/controller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ end
local startup_msg =
"Hello from inside Reaper Keys! I see the feedback window just opened... " ..
"Here are some things I have been told to tell you:\n" ..
"- If the feedback window is focused, I can't hear keys being pressed, be sure to unfocus it.\n" ..
"- Press <CM-x> (Ctrl + Alt + x) to open up a keybinding menu.\n" ..
"- Everything you need to configure reaper-keys is in REAPER/Scripts/reaper-keys/internal/definitions/\n" ..
"- If you would like to hide this message, set the option in internal/definitions/config.lua\n" ..
Expand All @@ -66,36 +65,35 @@ function feedback.update()
local feedback_view_open = model.getKey("open")
local just_opened = reaper_state.clearJustOpenedFlag()

if not feedback_view_open or just_opened then
feedback_view = FeedbackView:new()
feedback_view:open()
if feedback_view_open and not just_opened then
local update_number = model.getKey("update_number") or 0
if update_number > 20 then update_number = 0 end
model.setKeys({ update_number = update_number + 1 })
return
end

if config.show_start_up_message and not config.test then
reaper.ShowMessageBox(startup_msg, "Reaper Keys Open Message", 1)
end
feedback_view = FeedbackView:new()
feedback_view:open()

model.setKeys({ open = true })
if config.show_start_up_message and not config.test then
reaper.ShowMessageBox(startup_msg, "Reaper Keys Open Message", 1)
end

if config.profile then
local path = '/Scripts/ReaTeam Scripts/Development/cfillion_Lua profiler.lua'
Profiler = dofile(reaper.GetResourcePath() .. path)
Profiler.attachToWorld()
Profiler.start()
Profiler.run()
end
model.setKeys({ open = true })

reaper.atexit(function()
model.setKeys({ open = false })
local window_settings = feedback_view:getWindowSettings()
model.setKeys({ window_settings = window_settings })
end)
else
local update_number = model.getKey("update_number")
if not update_number or update_number > 20 then
update_number = 0
end
model.setKeys({ update_number = update_number + 1 })
if config.profile then
local path = '/Scripts/ReaTeam Scripts/Development/cfillion_Lua profiler.lua'
Profiler = dofile(reaper.GetResourcePath() .. path)
Profiler.attachToWorld()
Profiler.start()
Profiler.run()
end

reaper.atexit(function()
model.setKeys({ open = false })
local window_settings = feedback_view:getWindowSettings()
model.setKeys({ window_settings = window_settings })
end)
end

function feedback.displayMessage(message)
Expand Down

0 comments on commit fc967a6

Please sign in to comment.