Just starting out? Need help? Post your questions and find answers here.
rndrei
Enthusiast
Posts: 151 Joined: Thu Dec 28, 2023 9:04 pm
Post
by rndrei » Tue Mar 18, 2025 5:19 pm
How to find out if the keys are pressed (CTRL+)?
Code: Select all
Case #PB_Event_Menu
Select EventMenu()
Case #Ctrl and "+"
AZJIO
Addict
Posts: 2141 Joined: Sun May 14, 2017 1:48 am
Post
by AZJIO » Tue Mar 18, 2025 5:28 pm
Code: Select all
AddKeyboardShortcut(#Window , Shortcut , Event)
rndrei
Enthusiast
Posts: 151 Joined: Thu Dec 28, 2023 9:04 pm
Post
by rndrei » Tue Mar 18, 2025 5:33 pm
Code: Select all
AddKeyboardShortcut(#WINDOW, #PB_Shortcut_Control | #PB_Shortcut_+)
Shortcut_+ there is no such thing
AZJIO
Addict
Posts: 2141 Joined: Sun May 14, 2017 1:48 am
Post
by AZJIO » Tue Mar 18, 2025 5:35 pm
#PB_Shortcut_Add ?
moulder61
Enthusiast
Posts: 188 Joined: Sun Sep 19, 2021 6:16 pm
Location: U.K.
Post
by moulder61 » Tue Mar 18, 2025 5:38 pm
AZJIO beat me to it!
I was going to say how about #PB_Shortcut_Add? That's the + key?
Maybe that only applies to the keypad though?
I'm just guessing.
Moulder
rndrei
Enthusiast
Posts: 151 Joined: Thu Dec 28, 2023 9:04 pm
Post
by rndrei » Tue Mar 18, 2025 5:46 pm
doesn't work!
What will be the minus?
Code: Select all
#ctrlplus=100
AddKeyboardShortcut(#WINDOW, #PB_Shortcut_Control| #PB_Shortcut_Add, #ctrlplus)
Case #PB_Event_Menu
Select EventMenu()
Case #ctrlplus
debug("CTRL +")
AZJIO
Addict
Posts: 2141 Joined: Sun May 14, 2017 1:48 am
Post
by AZJIO » Tue Mar 18, 2025 5:50 pm
rndrei wrote: Tue Mar 18, 2025 5:46 pm
What will be the minus?
#PB_Shortcut_Subtract
rndrei
Enthusiast
Posts: 151 Joined: Thu Dec 28, 2023 9:04 pm
Post
by rndrei » Tue Mar 18, 2025 5:57 pm
NOT WORKED!
Code: Select all
#window=0
#ctrlplus=1
OpenWindow(#window, 0, 0, 250, 105, "pressed key..", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
AddKeyboardShortcut(#window, #PB_Shortcut_Control| #PB_Shortcut_Add, #ctrlplus)
Repeat
EventID=WaitWindowEvent()
Select EventID
Case #ctrlplus
Debug("pressed ctrl+")
EndSelect
Until WaitWindowEvent() = #PB_Event_CloseWindow
End
RASHAD
PureBasic Expert
Posts: 4945 Joined: Sun Apr 12, 2009 6:27 am
Post
by RASHAD » Tue Mar 18, 2025 5:59 pm
Are you using a lab?
Egypt my love
rndrei
Enthusiast
Posts: 151 Joined: Thu Dec 28, 2023 9:04 pm
Post
by rndrei » Tue Mar 18, 2025 6:01 pm
RASHAD wrote: Tue Mar 18, 2025 5:59 pm
Are you using a lab?
didn't understand the question?
AZJIO
Addict
Posts: 2141 Joined: Sun May 14, 2017 1:48 am
Post
by AZJIO » Tue Mar 18, 2025 6:04 pm
rndrei wrote: Tue Mar 18, 2025 5:57 pm
NOT WORKED!
Code: Select all
Case #PB_Event_Menu
Select EventMenu()
Case #ctrlplus
Turn on the NumLock numeric keypad and tap on it +
"+" is used with Shift, and "=" is used with Control
Last edited by
AZJIO on Tue Mar 18, 2025 6:07 pm, edited 1 time in total.
RASHAD
PureBasic Expert
Posts: 4945 Joined: Sun Apr 12, 2009 6:27 am
Post
by RASHAD » Tue Mar 18, 2025 6:05 pm
Your machine is a desktop or laptop?
Egypt my love
rndrei
Enthusiast
Posts: 151 Joined: Thu Dec 28, 2023 9:04 pm
Post
by rndrei » Tue Mar 18, 2025 6:09 pm
There is a desktop and a laptop!
What is the purpose of this question?
AZJIO
Addict
Posts: 2141 Joined: Sun May 14, 2017 1:48 am
Post
by AZJIO » Tue Mar 18, 2025 6:12 pm
In the help file, do this:
#PB_Shortcut_Return (Enter)
#PB_Shortcut_Add (+)
There are too many questions.
???
#PB_Shortcut_Select
#PB_Shortcut_Execute
#PB_Shortcut_Snapshot (PrtScn?)
#PB_Shortcut_Help
rndrei
Enthusiast
Posts: 151 Joined: Thu Dec 28, 2023 9:04 pm
Post
by rndrei » Tue Mar 18, 2025 6:22 pm
I have a laptop and there is no tab panel! Do you need plus and minus on the main keyboard?!
Can you add this feature in a future version? And are there any options now, for example a function in C?