pressed Ctrl+

Just starting out? Need help? Post your questions and find answers here.
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 151
Joined: Thu Dec 28, 2023 9:04 pm

pressed Ctrl+

Post by rndrei »

How to find out if the keys are pressed (CTRL+)?

Code: Select all

Case #PB_Event_Menu                                            
        Select EventMenu() 
          Case #Ctrl and "+"
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: pressed Ctrl+

Post by AZJIO »

Code: Select all

AddKeyboardShortcut(#Window , Shortcut , Event)

Code: Select all

if GetAsyncKeyState_(#VK_F1)
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 151
Joined: Thu Dec 28, 2023 9:04 pm

Re: pressed Ctrl+

Post by rndrei »

Code: Select all

 AddKeyboardShortcut(#WINDOW, #PB_Shortcut_Control | #PB_Shortcut_+)
Shortcut_+ there is no such thing
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: pressed Ctrl+

Post by AZJIO »

#PB_Shortcut_Add ?
User avatar
moulder61
Enthusiast
Enthusiast
Posts: 188
Joined: Sun Sep 19, 2021 6:16 pm
Location: U.K.

Re: pressed Ctrl+

Post by moulder61 »

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. :oops:

Moulder
"If it ain't broke, fix it until it is!

This message is brought to you thanks to SenselessComments.com

My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 151
Joined: Thu Dec 28, 2023 9:04 pm

Re: pressed Ctrl+

Post by rndrei »

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
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: pressed Ctrl+

Post by AZJIO »

rndrei wrote: Tue Mar 18, 2025 5:46 pm What will be the minus?
#PB_Shortcut_Subtract
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 151
Joined: Thu Dec 28, 2023 9:04 pm

Re: pressed Ctrl+

Post by rndrei »

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
PureBasic Expert
Posts: 4941
Joined: Sun Apr 12, 2009 6:27 am

Re: pressed Ctrl+

Post by RASHAD »

Are you using a lab?
Egypt my love
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 151
Joined: Thu Dec 28, 2023 9:04 pm

Re: pressed Ctrl+

Post by rndrei »

RASHAD wrote: Tue Mar 18, 2025 5:59 pm Are you using a lab?
didn't understand the question?
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: pressed Ctrl+

Post by AZJIO »

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
PureBasic Expert
Posts: 4941
Joined: Sun Apr 12, 2009 6:27 am

Re: pressed Ctrl+

Post by RASHAD »

Your machine is a desktop or laptop?
Egypt my love
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 151
Joined: Thu Dec 28, 2023 9:04 pm

Re: pressed Ctrl+

Post by rndrei »

There is a desktop and a laptop!
What is the purpose of this question?
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: pressed Ctrl+

Post by AZJIO »

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

Re: pressed Ctrl+

Post by rndrei »

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?
Post Reply