diff --git a/web/pgadmin/static/js/sqleditor/keyboard_shortcuts.js b/web/pgadmin/static/js/sqleditor/keyboard_shortcuts.js
index d31c6bed..c6175629 100644
--- a/web/pgadmin/static/js/sqleditor/keyboard_shortcuts.js
+++ b/web/pgadmin/static/js/sqleditor/keyboard_shortcuts.js
@@ -26,15 +26,15 @@ function keyboardShortcuts(sqlEditorController, queryToolActions, event) {
   } else if (((this.isMac() && event.metaKey) || (!this.isMac() && event.ctrlKey)) &&
     event.shiftKey && keyCode === FWD_SLASH_KEY) {
     _stopEventPropagation();
-    queryToolActions.commentLineCode(sqlEditorController);
+    queryToolActions.commentBlockCode(sqlEditorController);
   } else if (((this.isMac() && event.metaKey) || (!this.isMac() && event.ctrlKey)) &&
-    event.shiftKey && keyCode === PERIOD_KEY) {
+    keyCode === FWD_SLASH_KEY) {
     _stopEventPropagation();
-    queryToolActions.uncommentLineCode(sqlEditorController);
+    queryToolActions.commentLineCode(sqlEditorController);
   } else if (((this.isMac() && event.metaKey) || (!this.isMac() && event.ctrlKey)) &&
-    keyCode === FWD_SLASH_KEY) {
+    keyCode === PERIOD_KEY) {
     _stopEventPropagation();
-    queryToolActions.commentBlockCode(sqlEditorController);
+    queryToolActions.uncommentLineCode(sqlEditorController);
   }
 
   function _stopEventPropagation() {
diff --git a/web/pgadmin/tools/datagrid/templates/datagrid/index.html b/web/pgadmin/tools/datagrid/templates/datagrid/index.html
index 35d581b7..dfd11b3e 100644
--- a/web/pgadmin/tools/datagrid/templates/datagrid/index.html
+++ b/web/pgadmin/tools/datagrid/templates/datagrid/index.html
@@ -140,21 +140,21 @@
                         
                         
                         
                         
                     
                 
diff --git a/web/regression/javascript/sqleditor/keyboard_shortcuts_spec.js b/web/regression/javascript/sqleditor/keyboard_shortcuts_spec.js
index d16ac562..3b731620 100644
--- a/web/regression/javascript/sqleditor/keyboard_shortcuts_spec.js
+++ b/web/regression/javascript/sqleditor/keyboard_shortcuts_spec.js
@@ -181,7 +181,6 @@ describe('the keyboard shortcuts', () => {
         beforeEach(() => {
           macKeysSetup();
           event.which = FWD_SLASH_KEY;
-          event.shiftKey = true;
           keyboardShortcuts.processEvent(sqlEditorControllerSpy, queryToolActionsSpy, event);
         });
 
@@ -196,7 +195,6 @@ describe('the keyboard shortcuts', () => {
         beforeEach(() => {
           windowsKeysSetup();
           event.which = FWD_SLASH_KEY;
-          event.shiftKey = true;
           keyboardShortcuts.processEvent(sqlEditorControllerSpy, queryToolActionsSpy, event);
         });
 
@@ -216,7 +214,6 @@ describe('the keyboard shortcuts', () => {
         beforeEach(() => {
           macKeysSetup();
           event.which = FWD_SLASH_KEY;
-          event.shiftKey = true;
         });
 
         it('does nothing', () => {
@@ -247,7 +244,6 @@ describe('the keyboard shortcuts', () => {
         beforeEach(() => {
           macKeysSetup();
           event.which = PERIOD_KEY;
-          event.shiftKey = true;
           keyboardShortcuts.processEvent(sqlEditorControllerSpy, queryToolActionsSpy, event);
         });
 
@@ -261,7 +257,6 @@ describe('the keyboard shortcuts', () => {
         beforeEach(() => {
           windowsKeysSetup();
           event.which = PERIOD_KEY;
-          event.shiftKey = true;
           keyboardShortcuts.processEvent(sqlEditorControllerSpy, queryToolActionsSpy, event);
         });
 
@@ -281,7 +276,6 @@ describe('the keyboard shortcuts', () => {
         beforeEach(() => {
           macKeysSetup();
           event.which = PERIOD_KEY;
-          event.shiftKey = true;
         });
 
         it('does nothing', () => {
@@ -310,6 +304,7 @@ describe('the keyboard shortcuts', () => {
         beforeEach(() => {
           macKeysSetup();
           event.which = FWD_SLASH_KEY;
+          event.shiftKey = true;
           keyboardShortcuts.processEvent(sqlEditorControllerSpy, queryToolActionsSpy, event);
         });
 
@@ -326,6 +321,7 @@ describe('the keyboard shortcuts', () => {
         beforeEach(() => {
           windowsKeysSetup();
           event.which = FWD_SLASH_KEY;
+          event.shiftKey = true;
           keyboardShortcuts.processEvent(sqlEditorControllerSpy, queryToolActionsSpy, event);
         });
 
@@ -345,6 +341,7 @@ describe('the keyboard shortcuts', () => {
         beforeEach(() => {
           macKeysSetup();
           event.which = FWD_SLASH_KEY;
+          event.shiftKey = true;
           keyboardShortcuts.processEvent(sqlEditorControllerSpy, queryToolActionsSpy, event);
         });
         it('does nothing', () => {
@@ -355,6 +352,7 @@ describe('the keyboard shortcuts', () => {
         beforeEach(() => {
           windowsKeysSetup();
           event.which = FWD_SLASH_KEY;
+          event.shiftKey = true;
           keyboardShortcuts.processEvent(sqlEditorControllerSpy, queryToolActionsSpy, event);
         });
         it('does nothing', () => {