Skip to content

Commit 620f5ad

Browse files
authored
Refactor keyboard shortcut handling for 'D' key
1 parent 7d96b28 commit 620f5ad

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

scripts/UI/Keyboard-Shortcuts .ps1

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
$KeyEvents = {
22

3-
if ($itt.ProcessRunning) {
4-
Set-Statusbar -Text "📢 Shortcut is disabled while process is running"
5-
return
6-
}
7-
83
$modifiers = $_.KeyboardDevice.Modifiers
94
$key = $_.Key
105

@@ -20,7 +15,10 @@ $KeyEvents = {
2015
}
2116
elseif ($modifiers -eq "Shift") { Save-File }
2217
}
23-
"D" { if ($modifiers -eq "Shift") { Get-file } }
18+
"D" {
19+
if ($itt.ProcessRunning) { Set-Statusbar -Text "📢 Shortcut is disabled while process is running" return }
20+
if ($modifiers -eq "Shift") { Get-file }
21+
}
2422
"Q" {
2523
if ($modifiers -eq "Ctrl") {
2624
$itt.TabControl.SelectedItem = $itt.TabControl.Items | Where-Object { $_.Name -eq "apps" }
@@ -51,4 +49,4 @@ $KeyEvents = {
5149
}
5250
}
5351
}
54-
}
52+
}

0 commit comments

Comments
 (0)