Skip to content

Commit c3e9560

Browse files
committed
Support Ctrl-X in addition to Ctrl-C or automatic closing
1 parent 77e7de1 commit c3e9560

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Simulationcraft.toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## IconTexture: Interface\Addons\SimulationCraft\logo
44
## Notes: Constructs SimC export strings
55
## Author: Theck, navv_, seriallos
6-
## Version: 11.1.0-01
6+
## Version: 11.1.0-02
77
## OptionalDependencies: Ace3, LibRealmInfo, LibDBIcon, LibDataBroker-1.1
88
## SavedVariables: SimulationCraftDB
99

core.lua

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -715,21 +715,24 @@ function Simulationcraft:GetMainFrame(text)
715715
eb:SetFontObject("ChatFontNormal")
716716
eb:SetScript("OnEscapePressed", function() f:Hide() end)
717717
eb:SetScript("OnKeyDown", function(self, key)
718-
if key == "LCTRL" or key == "RCTRL" then
718+
if key == "LCTRL" or key == "RCTRL" or key == "LMETA" or key == "RMETA" then
719719
ctrlDown = true
720720
end
721721
end)
722722
eb:SetScript("OnKeyUp", function(self, key)
723-
if key == "LCTRL" or key == "RCTRL" then
723+
if key == "LCTRL" or key == "RCTRL" or key == "LMETA" or key == "RMETA" then
724724
-- Add a small grace period. In testing, the way I press Ctrl-C would sometimes have Ctrl keyup bfore C
725725
C_Timer.After(0.2, function() ctrlDown = false end)
726726
end
727-
if ctrlDown and key == "C" then
728-
if OptionsDB.profile.closeOnCopy then
729-
-- Just in case there's some weird way that WoW could close the window before the OS copies
730-
C_Timer.After(0.1, function()
731-
f:Hide()
732-
end)
727+
if ctrlDown then
728+
-- handle copy or cut
729+
if key == "C" or key == "X" then
730+
if OptionsDB.profile.closeOnCopy then
731+
-- Just in case there's some weird way that WoW could close the window before the OS copies
732+
C_Timer.After(0.1, function()
733+
f:Hide()
734+
end)
735+
end
733736
end
734737
end
735738
end)

0 commit comments

Comments
 (0)