-
May 21st, 2006, 07:04 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Disabling Certain Keys
Does anybody know how to disable only certain keys of the keyboard? I know about the blockinput(true/false) API but that blocks ALL the input including all of the mouse and the keyboard whereas all I want is blocking only certain keys e.g. A B C End Home etc. If someone knows then please tell.
-
May 21st, 2006, 08:22 AM
#2
Junior Member
Re: Disabling Certain Keys
maybe try keycode or keydown... and if KeyCode = TheKeyYouWannaBlock Then Stop it... or something...
wild guess
-
May 21st, 2006, 04:42 PM
#3
Addicted Member
Re: Disabling Certain Keys
I agree... using keydown or keypress will "block" keys within your form or controls.
What key(s) are you trying to "block" ? And do you want to "block" them in just your app or system wide ?
Last edited by Keith_VB6; May 21st, 2006 at 04:43 PM.
Reason: typos
Keith_VB6
If you have any further questions, just ask.
If this solves things, then please mark the thread resolved.
[Thread Tools] --> [Mark Thread Resolved]
-
May 21st, 2006, 04:55 PM
#4
Re: Disabling Certain Keys
Not sure why you would want to block certain basic keys system wide?
How would you write an email or do anything with certain alpha characters blocked?
What are you trying to accomplish?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 21st, 2006, 05:03 PM
#5
Addicted Member
Re: Disabling Certain Keys
I only asked "system wide" in case lone_REBEL was trying to block system keys such as print-screen or ALT-CTR-BREAK. Something, I personally don't like doing. I didn't mean, block the "K" key.
Keith_VB6
If you have any further questions, just ask.
If this solves things, then please mark the thread resolved.
[Thread Tools] --> [Mark Thread Resolved]
-
May 21st, 2006, 05:07 PM
#6
Re: Disabling Certain Keys
Oh, I know. Its just I read that he already tried using the BlockInput API which is system wide.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 24th, 2006, 03:04 AM
#7
Thread Starter
Hyperactive Member
Re: Disabling Certain Keys
actually I want to block the keys system-wide since blocking keys in your app is such foolishly simple you can just use
Private Sub ObjectName_KeyPress(KeyAscii As Long)
If KeyAscii=YourBlockingKeyAscii Then
KeyAscii=0
End If
Actually what I'm trying to do is blocking my space key since it is teasing me so much in gaming. Can you please tell me a way??
-
May 24th, 2006, 03:12 AM
#8
Re: Disabling Certain Keys
check out the GetAsyncKeyState API.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 24th, 2006, 04:20 AM
#9
Thread Starter
Hyperactive Member
Re: Disabling Certain Keys
Oh man the GetAsyncKeyState tells me what keys have been pressed or are being pressed, if I get the ascii of my blocked key there, how can I stop the input??
I mean while in game, when the space is pressed (by my ill fate), by the time I find out that the space key has been pressed, I wont be able to "undo" the press action and my poor character will be dead by that time!
What do I do to DISABLE the input of space key to ALL the running apps at the time??
-
May 24th, 2006, 04:24 AM
#10
Re: Disabling Certain Keys
Not sure as I havent done much on blocking inputs.
Wy does the space bar kill your character? Sounds like a suicide feature
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 24th, 2006, 04:28 AM
#11
Re: Disabling Certain Keys
Why would you block input to all other applications? You should try to correct the code in the game itself rather than blocking the input.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
May 24th, 2006, 04:37 AM
#12
Re: Disabling Certain Keys
I dont think he has access to the source.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 24th, 2006, 04:43 AM
#13
Hyperactive Member
Re: Disabling Certain Keys
You'll need a low level keyboard hook, here's a link
http://www.codeguru.com/vb/gen/vb_sy...icle.php/c4829
-
May 24th, 2006, 04:45 AM
#14
Re: Disabling Certain Keys
Ooooh, jo0ls burned you Shuja Ali. An article from CG.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 24th, 2006, 05:07 AM
#15
Re: Disabling Certain Keys
Originally Posted by RobDog888
Ooooh, jo0ls burned you Shuja Ali. An article from CG.
:burning:
I still will not disable the space key system wide. And that too using CallBack functions will be tedious for a newbie.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
May 24th, 2006, 05:24 AM
#16
Thread Starter
Hyperactive Member
Re: Disabling Certain Keys
I've got the code and its working but I don't know how it damn works!
Looks like I'll have to be contented that at least I got the code (even if in greek)
-
May 24th, 2006, 05:26 AM
#17
Re: Disabling Certain Keys
Originally Posted by lone_REBEL
Actually what I'm trying to do is blocking my space key since it is teasing me so much in gaming. Can you please tell me a way??
Your easiest solution is to pull the space bar off the keyboard whilst playing (that's not a joke - i have no left Windows key on my keyboard for just such a reason.)
-
May 24th, 2006, 05:27 AM
#18
Re: Disabling Certain Keys
Originally Posted by bushmobile
Your easiest solution is to pull the space bar off the keyboard whilst playing (that's not a joke - i have no left Windows key on my keyboard for just such a reason.)
And it is just a two second job, no coding required and no need to understand those horrible API's.
Edit-- Finally 1000
Use [code] source code here[/code] tags when you post source code.
My Articles
-
May 24th, 2006, 05:33 AM
#19
Re: Disabling Certain Keys
Originally Posted by bushmobile
Your easiest solution is to pull the space bar off the keyboard whilst playing (that's not a joke - i have no left Windows key on my keyboard for just such a reason.)
I actually was going to suggest that earlier in the thread!
Ps, Congrats on 1,000 posts Shuja Ali
Glad to see you have made VBF your home over CG
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 24th, 2006, 05:36 AM
#20
Re: Disabling Certain Keys
Use [code] source code here[/code] tags when you post source code.
My Articles
-
May 24th, 2006, 05:39 AM
#21
Thread Starter
Hyperactive Member
Re: Disabling Certain Keys
Hahahahaha!
Ever heard about the "Silh's" keyboards??
My kb had builtin protrudings that prohibits me from such a job!
-
May 24th, 2006, 05:42 AM
#22
Re: Disabling Certain Keys
Use a joystick or other game controller to play the game. Problem solved. No c0d needed.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 24th, 2006, 05:57 AM
#23
Re: Disabling Certain Keys
what's a Silh's keyboard?
-
May 25th, 2006, 04:33 AM
#24
Thread Starter
Hyperactive Member
Re: Disabling Certain Keys
Fool its my keyboard manufacturer company name
And they make some terrible PC products!
Bye the way my question has been solved. Thanx to you jo0ls.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|