Author Topic: Function Hotkey & Combined Hotkeys not working  (Read 502 times)

pranit@srcomsec

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
Function Hotkey & Combined Hotkeys not working
« on: November 08, 2022, 03:29:37 pm »
We are working on a grid that requires, multiple combinations of Hotkeys, such as 'Shift + F2' or 'Ctrl + Enter', which we are not being able to do currently. Also if we are using 'F1', 'F3' or 'F5' hotkey, the browsers functions for these keys are also being run such as 'F1' also runs the browser help or 'F5' reloads the page.

Is there a workaround for this?

Thanks

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Function Hotkey & Combined Hotkeys not working
« Reply #1 on: November 08, 2022, 05:31:49 pm »
Currently pqgrid doesn't use or support any hot key.

pranit@srcomsec

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
Re: Function Hotkey & Combined Hotkeys not working
« Reply #2 on: November 08, 2022, 05:49:17 pm »
Thank you for your quick response.

I mean keypress (beforeCellKeyDown) event with F1 is working with the grid but it will also open the browser help window.

Can we stop opening the browser help window when the user clicks on the F1 key?

Let me know if you have any workaround solution.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Function Hotkey & Combined Hotkeys not working
« Reply #3 on: November 08, 2022, 06:42:32 pm »
you can add this in the event listener

Code: [Select]
beforeCellKeyDown: function(evt, ui){
                if( evt.keyCode is equal to keycode for F1 ){
                      //.....your custom action...
                  evt.preventDefault();
                }
},
« Last Edit: November 09, 2022, 06:23:17 am by paramvir »

pranit@srcomsec

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
Re: Function Hotkey & Combined Hotkeys not working
« Reply #4 on: November 24, 2022, 06:35:20 pm »
Using the keypress (beforeCellKeyDown) event we are only being able to capture single keys such as {F1}, {F2}, {Enter}.

But we are not being able to capture combo keypress such as {Ctrl} + {F1}

Kindly look into this

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Function Hotkey & Combined Hotkeys not working
« Reply #5 on: November 28, 2022, 06:32:47 am »
ctrl key can be checked by evt.ctrlKey

so you can combine both the conditions.

pranit@srcomsec

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
Re: Function Hotkey & Combined Hotkeys not working
« Reply #6 on: November 28, 2022, 12:58:18 pm »
Thanks for your suggestion, it is working fine.