Skip to content

Commit

Permalink
Adds support for CTRL key as a modifier for Query shortcuts (apache#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
renato-bohler authored Dec 5, 2023
1 parent 96c2f3d commit b25f7cf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pinot-controller/src/main/resources/app/pages/Query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,14 @@ const QueryPage = () => {
};

const handleQueryInterfaceKeyDown = (editor, event) => {
// Map Cmd + Enter KeyPress to executing the query
if (event.metaKey == true && event.keyCode == 13) {
const modifiedEnabled = event.metaKey == true || event.ctrlKey == true;

// Map (Cmd/Ctrl) + Enter KeyPress to executing the query
if (modifiedEnabled && event.keyCode == 13) {
handleRunNow(editor.getValue());
}
// Map Cmd + / KeyPress to toggle commenting the query
if (event.metaKey == true && event.keyCode == 191) {
// Map (Cmd/Ctrl) + / KeyPress to toggle commenting the query
if (modifiedEnabled && event.keyCode == 191) {
handleComment(editor);
}
}
Expand Down

0 comments on commit b25f7cf

Please sign in to comment.