Skip to content

Commit

Permalink
fix(hobbit): refine key bindings for approval processor
Browse files Browse the repository at this point in the history
Update the key bindings in ApprovalExecuteProcessor to use KeyEvent constants for clarity and consistency. This change replaces the string-based KeyStroke definition with the corresponding KeyEvent VK constant and InputEvent modifier.
  • Loading branch information
phodal committed Oct 10, 2024
1 parent c4066f6 commit d402baa
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import com.intellij.openapi.ui.popup.JBPopup
import com.intellij.openapi.ui.popup.JBPopupFactory
import com.intellij.ui.dsl.builder.panel
import com.intellij.util.ui.JBUI
import java.awt.event.InputEvent
import java.awt.event.KeyEvent
import java.util.concurrent.CompletableFuture
import javax.swing.JButton
import javax.swing.JComponent
Expand Down Expand Up @@ -94,15 +96,15 @@ class PendingApprovalPanel : JPanel() {
{
popup.closeOk(null)
approveButton.doClick()
}, KeyStroke.getKeyStroke("ctrl ENTER"), JComponent.WHEN_IN_FOCUSED_WINDOW
}, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_DOWN_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW
)

rejectButton.addActionListener(reject)
rejectButton.registerKeyboardAction(
{
popup.closeOk(null)
rejectButton.doClick()
}, KeyStroke.getKeyStroke("ctrl DELETE"), JComponent.WHEN_IN_FOCUSED_WINDOW
}, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, InputEvent.CTRL_DOWN_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW
)
}
}

0 comments on commit d402baa

Please sign in to comment.