PureBasic Forum
https://www.purebasic.fr/english/

Form Designer doesnt allow '+' or '-' in keyboard Shortcuts
https://www.purebasic.fr/english/viewtopic.php?f=4&t=64531
Page 1 of 1

Author:  Keya [ Sat Jan 09, 2016 8:31 am ]
Post subject:  Form Designer doesnt allow '+' or '-' in keyboard Shortcuts

Using + as the Shortcut results in the following code which prevents compile:
Code:
AddKeyboardShortcut(#Window0, #PB_Shortcut_ | #PB_Shortcut_, #menuitem)

Im assuming its parser is at fault when looking for combinations, eg "Ctrl+A", but + is of course a valid key and should map to #PB_Shortcut_Add

- also fails:
Code:
AddKeyboardShortcut(#Window0, #PB_Shortcut_-, #menuitem)
#PB_Shortcut_- doesnt exist, and should map to #PB_Shortcut_Subtract

My ungainly but effective workaround is to remove the Shortcut from the menu item in the designer, and manually reset menu text (required to add the $Tab + Shortcut part) and manually add the keyboard shortcut in my startup code:
Code:
  SetMenuItemText(0,#mnuZoomIn, "Zoom In"+#TAB$+"+")
  AddKeyboardShortcut(#Window0, #PB_Shortcut_Add, #mnuZoomIn)

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/