1. Kailainathan Kasinathan
  2. PowerBuilder
  3. Tuesday, 11 December 2018 09:17 AM UTC

Hi All,

I have a button in my application. This button opens a window. 

As of now, I am asked to add a keyboard shortcut to open the window. Can you guys help me on how to do that?

 

I need a  keyboard shortcut to opens the window 

Andres Slachevsky Accepted Answer Pending Moderation
  1. Wednesday, 12 December 2018 12:24 PM UTC
  2. PowerBuilder
  3. # 1

You can use the key event on the windows where the Button is 

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 11 December 2018 16:20 PM UTC
  2. PowerBuilder
  3. # 2

Hi Kailainathan ;

   One of the easiest ways to do that is to add an accelerator to the CB itself. For example the CB's text states "Open Sesame". Just edit the CB text to "Open &Sesame". Now the user can run the CB by using ALT+S. Of course, the "&" for the accelerator can be placed on any letter in the CB text to suite the logistics of the window processing for a better UX for your users.

HTH

Regards ... Chris

Comment
  1. Roland Smith
  2. Tuesday, 11 December 2018 16:29 PM UTC
Using Windows XP and earlier the letter with the & would be underlined. Newer versions of Windows it is an option that is off by default. This page shows how to change the option:

https://www.groovypost.com/howto/make-windows-10-highlight-underline-menu-shortcut-keys/

  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 11 December 2018 16:54 PM UTC
Hi Roland;

"Kool" tip!



Note though that you do not have to change the O/S. Just pressing the ALT key first forces MS-Windows to show all the accelerator letters in your current App window(s) and menus. Then you can select the appropriate accelerator letter.



Regards ... Chris
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 11 December 2018 13:36 PM UTC
  2. PowerBuilder
  3. # 3

Add an item to the menu. You can hide the item if you want and put a shortcut key combo on it. The menu item would then trigger the clicked event.

Something like this should work:

w_main lw_parent

lw_parent = ParentWindow

lw_parent.cb_openwin.TriggerEvent("clicked")

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.