Pressed Ctrl+ and Ctrl-

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 153
Joined: Thu Dec 28, 2023 9:04 pm

Pressed Ctrl+ and Ctrl-

Post by rndrei »

Please add constants for AddKeyboardShortcut. Ctrl+ and Ctrl- on the main keyboard without a tab panel!
Quin
Addict
Addict
Posts: 1133
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Pressed Ctrl+ and Ctrl-

Post by Quin »

+1, but I recommend changing topic title to something like: Add #PB_Shortcut_Minus, #PB_Shortcut_Plus, #PB_Shortcut_Equals constants.
normeus
Enthusiast
Enthusiast
Posts: 472
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: Pressed Ctrl+ and Ctrl-

Post 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
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 153
Joined: Thu Dec 28, 2023 9:04 pm

Re: Pressed Ctrl+ and Ctrl-

Post by rndrei »

The compiler complains, VK_OEM_PLUS
Quin
Addict
Addict
Posts: 1133
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Pressed Ctrl+ and Ctrl-

Post by Quin »

rndrei wrote: Wed Mar 19, 2025 11:39 am The compiler complains, VK_OEM_PLUS
Only works on Windows :(
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: Pressed Ctrl+ and Ctrl-

Post 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.
User avatar
HeX0R
Addict
Addict
Posts: 1204
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Pressed Ctrl+ and Ctrl-

Post 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
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 153
Joined: Thu Dec 28, 2023 9:04 pm

Re: Pressed Ctrl+ and Ctrl-

Post by rndrei »

What you need!Thank you!
User avatar
NicTheQuick
Addict
Addict
Posts: 1519
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Pressed Ctrl+ and Ctrl-

Post 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.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 153
Joined: Thu Dec 28, 2023 9:04 pm

Re: Pressed Ctrl+ and Ctrl-

Post by rndrei »

On my layout, the key (+) is equal to the keys (=)

Code: Select all

AddKeyboardShortcut(0, Asc("="), 0)
Quin
Addict
Addict
Posts: 1133
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Pressed Ctrl+ and Ctrl-

Post 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 +.
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Pressed Ctrl+ and Ctrl-

Post by miso »

Also in Hungarian keyboard layout. "Shift" + numeric "3" results a "+". But I always use keypad+ while typing.
Post Reply