473,788 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disabling Function keys

Apologies if this has been covered recently - I lurked and saw nothing.

I have an application that does ticketing at a three-screen movie theatre,
and I'm using the function keys F1 thru F12 due to their intuitive layout.
I KeyPreview them to the form, and read them using the KeyDown event (since
KeyPress doesn't see non-ANSI keys). Everything works fine, EXCEPT.

After executing my code, a few of the keys go ahead with what they USUALLY
do (F1 brings up Help, F10 highlights the File menu choice, F11 brings up
the Database Window, and F12 does a Save As). I know I can disable F1=Help
at the OS level (XP here), but I don't want the user to have to do that on
his POS PC's. And the keys that act within Access (2000) have no apparent
way to disable them.

Is there something similar to CancelEvent that will stop the processing of a
keystroke after I'm done with it? Can I do this some other way?

Thanks for any ideas or novel approaches.

Armando

Nov 13 '05 #1
3 9169
Armando wrote:
Apologies if this has been covered recently - I lurked and saw nothing.

I have an application that does ticketing at a three-screen movie theatre,
and I'm using the function keys F1 thru F12 due to their intuitive layout.
I KeyPreview them to the form, and read them using the KeyDown event (since
KeyPress doesn't see non-ANSI keys). Everything works fine, EXCEPT.

After executing my code, a few of the keys go ahead with what they USUALLY
do (F1 brings up Help, F10 highlights the File menu choice, F11 brings up
the Database Window, and F12 does a Save As). I know I can disable F1=Help
at the OS level (XP here), but I don't want the user to have to do that on
his POS PC's. And the keys that act within Access (2000) have no apparent
way to disable them.

Is there something similar to CancelEvent that will stop the processing of a
keystroke after I'm done with it? Can I do this some other way?


No novel ideas. Set the KeyValue = 0 after you are done with it to
prevent further processing.

Private Sub Form_KeyDown(Ke yCode As Integer, Shift As Integer)
Dim intAltDown As Integer

intAltDown = (Shift And acAltMask) > 0
'Debug.Print acAltMask, KeyCode
If intAltDown And KeyCode = 84 Then
Me.cmdAddNew.Vi sible = Not Me.cmdAddNew.Vi sible 'toggle button
KeyCode = 0 ' disable additional processing
End If

End Sub

--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #2
In the KeyDown event, after you detect and process the keystroke, destroy
the keystroke by setting KeyCode to zero, i.e.:
KeyCode = 0

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Armando" <ar*****@bogusa ddress.com> wrote in message
news:LE******** ***********@new s1.epix.net...
Apologies if this has been covered recently - I lurked and saw nothing.

I have an application that does ticketing at a three-screen movie theatre,
and I'm using the function keys F1 thru F12 due to their intuitive layout.
I KeyPreview them to the form, and read them using the KeyDown event
(since
KeyPress doesn't see non-ANSI keys). Everything works fine, EXCEPT.

After executing my code, a few of the keys go ahead with what they USUALLY
do (F1 brings up Help, F10 highlights the File menu choice, F11 brings up
the Database Window, and F12 does a Save As). I know I can disable
F1=Help
at the OS level (XP here), but I don't want the user to have to do that on
his POS PC's. And the keys that act within Access (2000) have no apparent
way to disable them.

Is there something similar to CancelEvent that will stop the processing of
a
keystroke after I'm done with it? Can I do this some other way?

Thanks for any ideas or novel approaches.

Armando

Nov 13 '05 #3
A thousand thanks to John, Allen, and anyone else who may reply. It works
like a charm. This is the sort of trick I knew you guys would have stashed
away. Now I have it, too!

Merry Christmas to all,

Armando
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4907
by: Niels Borg | last post by:
Hi, I am building an app, where I would like to disable the standard windows function keys. I.E. F4 which expands a a selected drop-down list. Can anyone help me on that? Many thanks Niels Borg
1
5421
by: Don W. | last post by:
I need to use some function keys as speed-keys (instead of clicking a button with the mouse.) Using this code doesn't display any codes for the function keys: <html><body> <SCRIPT LANGUAGE="JavaScript"> document.onkeypress = Check_key; function Check_key() {
1
6846
by: Steve | last post by:
I would like to override the IsInputKey function in order to trap the arrow up/down keys in the Key Events. I understand that arrow keys don't have a char representation and thus, hard to trap. Someone wrote this override for IsInputKey in C# which apparently worked, and I tried to convert it to VB.Net but not working. Here is the C# version and following - my conversion. It would be great if anyone out there knows how to do this...
4
6710
by: Broeisi | last post by:
Hello, I'm trying to write a console based program in C in Linux. I want to use the function keys in my program, but I don;t know how to let the C program know when for exmaple the F1 key is pressed. I want to be able to use all 12 Function keys in my program. Can someone help me maybe on this one? I guess that those function keys also have an ascii number.
1
11011
by: apax999 | last post by:
Kinda new to SQL, using SQL Server 2005. I have some foreign keys in a couple of tables. I need to drop these tables, but can't since I'll get the error: Msg 3726, Level 16, State 1, Line 1 Could not drop object 'Client' because it is referenced by a FOREIGN KEY constraint.
1
2052
by: Sam Samson | last post by:
Greeetings All .. For my users convenience I have mapped function keys F2 .. F12 to change the tabs on the Tabcontrol. Works like a charm <ominous musicuntil one hits F8</ominous music> That particular tabpage has a webbrowser object embedded in it .. and after it flicks to that tabpage it no longer plays nice with the other Tabpages .. click on another Tab using the mouse and all is wonderful again. (unless
9
2397
by: Wingot | last post by:
Hey, I am using Visual Studio 2008 Beta 2 for some application development in C#, but I presume that the following question applies equally well to any environment.
2
2950
by: Gouri.Mahajan7 | last post by:
Hello, Can anybody please tell me how to disable the shortcuts of the internet explorer? I have hosted control on the web page and i want to give the inputs such as Ctrl+A, Ctrl+B and so on.. but whenever I type them pop up windows open in internet explorer. How to disable them?? Thanks.
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5403
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.