Pressed Ctrl+ and Ctrl-
Posted: Tue Mar 18, 2025 6:47 pm
Please add constants for AddKeyboardShortcut. Ctrl+ and Ctrl- on the main keyboard without a tab panel!
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
AddKeyboardShortcut(#window, #PB_Shortcut_Shift|#PB_Shortcut_Control|#VK_OEM_PLUS, #ctrlplus)
AddKeyboardShortcut(#window, #PB_Shortcut_Shift|#PB_Shortcut_Control|#VK_OEM_MINUS, #ctrlminus)
Only works on Windows
This wasn't initially revealed to us when we tried to help. So when he refers to "main keyboard without a tab panel", he means a keyboard without a numeric keypad.
Code: Select all
OpenWindow(0, 200, 200, 200, 100, "Bla")
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
AddKeyboardShortcut(0, #VK_OEM_PLUS, 0)
AddKeyboardShortcut(0, #VK_OEM_MINUS, 2)
CompilerElse
AddKeyboardShortcut(0, Asc("+"), 0)
AddKeyboardShortcut(0, Asc("-"), 2)
CompilerEndIf
AddKeyboardShortcut(0, #PB_Shortcut_Add, 1)
AddKeyboardShortcut(0, #PB_Shortcut_Subtract, 3)
Repeat
Select WaitWindowEvent()
Case #PB_Event_Menu
Select EventMenu()
Case 0 : Debug "Plus"
Case 1 : Debug "Plus Keypad"
Case 2 : Debug "Minus"
Case 3 : Debug "Minus Keypad"
EndSelect
Case #PB_Event_CloseWindow
End
EndSelect
ForEverOn what layout do you need Shift to write a plus sign? On the German layout you can just type `+` without Shift.normeus wrote: Tue Mar 18, 2025 8:08 pmcontrol plus on the keyboard does not exist,you need to also press shift to get plus , if you you do not press shift you'll get equalsCode: Select all
AddKeyboardShortcut(#window, #PB_Shortcut_Shift|#PB_Shortcut_Control|#VK_OEM_PLUS, #ctrlplus) AddKeyboardShortcut(#window, #PB_Shortcut_Shift|#PB_Shortcut_Control|#VK_OEM_MINUS, #ctrlminus)
Norm
Code: Select all
AddKeyboardShortcut(0, Asc("="), 0)American English. = is the key directly to the left of backspace, hold shift and press it to get a +.NicTheQuick wrote: Fri Apr 11, 2025 9:49 am On what layout do you need Shift to write a plus sign? On the German layout you can just type `+` without Shift.