Page 1 of 1

Pressed Ctrl+ and Ctrl-

Posted: Tue Mar 18, 2025 6:47 pm
by rndrei
Please add constants for AddKeyboardShortcut. Ctrl+ and Ctrl- on the main keyboard without a tab panel!

Re: Pressed Ctrl+ and Ctrl-

Posted: Tue Mar 18, 2025 7:05 pm
by Quin
+1, but I recommend changing topic title to something like: Add #PB_Shortcut_Minus, #PB_Shortcut_Plus, #PB_Shortcut_Equals constants.

Re: Pressed Ctrl+ and Ctrl-

Posted: Tue Mar 18, 2025 8:08 pm
by normeus

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)
control 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 equals

Norm

Re: Pressed Ctrl+ and Ctrl-

Posted: Wed Mar 19, 2025 11:39 am
by rndrei
The compiler complains, VK_OEM_PLUS

Re: Pressed Ctrl+ and Ctrl-

Posted: Wed Mar 19, 2025 12:39 pm
by Quin
rndrei wrote: Wed Mar 19, 2025 11:39 am The compiler complains, VK_OEM_PLUS
Only works on Windows :(

Re: Pressed Ctrl+ and Ctrl-

Posted: Wed Mar 19, 2025 1:22 pm
by BarryG
rndrei finally said in another post that he uses a Linux laptop with no numeric keypad:
rndrei wrote: Wed Mar 19, 2025 11:49 amI work on Linux. Keyboard without pad.
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.

Re: Pressed Ctrl+ and Ctrl-

Posted: Wed Mar 19, 2025 4:54 pm
by HeX0R
definitely my last reply to anything from rndrei

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
ForEver
might not work on that fruit-OS

Re: Pressed Ctrl+ and Ctrl-

Posted: Fri Apr 11, 2025 9:00 am
by rndrei
What you need!Thank you!

Re: Pressed Ctrl+ and Ctrl-

Posted: Fri Apr 11, 2025 9:49 am
by NicTheQuick
normeus wrote: Tue Mar 18, 2025 8:08 pm

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)
control 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 equals

Norm
On what layout do you need Shift to write a plus sign? On the German layout you can just type `+` without Shift.

Re: Pressed Ctrl+ and Ctrl-

Posted: Fri Apr 11, 2025 9:56 am
by rndrei
On my layout, the key (+) is equal to the keys (=)

Code: Select all

AddKeyboardShortcut(0, Asc("="), 0)

Re: Pressed Ctrl+ and Ctrl-

Posted: Fri Apr 11, 2025 1:32 pm
by Quin
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.
American English. = is the key directly to the left of backspace, hold shift and press it to get a +.

Re: Pressed Ctrl+ and Ctrl-

Posted: Fri Apr 11, 2025 5:24 pm
by miso
Also in Hungarian keyboard layout. "Shift" + numeric "3" results a "+". But I always use keypad+ while typing.