hi guys,
hey i looked everywere and i can't for the life of me find the ascii codes for these keys: ctrl (the control button, bottom left corner of keyboard) alt (the alt button, either side of the spacebar)
thanks guys, even if you link me the URL for a site that will help
thanks again in advance
sgrec7
13 3012
hi guys,
hey i looked everywere and i can't for the life of me find the ascii codes for these keys: ctrl (the control button, bottom left corner of keyboard) alt (the alt button, either side of the spacebar)
thanks guys, even if you link me the URL for a site that will help
thanks again in advance
sgrec7
ctrl ---> 17
alt ---> 18
you can have it on a text box if you write in some other controls KeyDown event something like
textbox1.text = keycode
then just select that control an press the key you want to know ;)
These keys don't have ASCII codes.
ASCII defines values for the character set. These are keyboard keys, not characters.
The difference between KeyDown and KeyPress events is that one reports the actual key pressed, while the other reports the ASCII character which was generated as a result. For example, pressing the "A" key generates the keycode for that key (65). Depending on the current state of the Caps-Lock, Shift, Control and Alt and Shift keys, the ASCII character generated might be... "A" (code 65), "a" (code 97), "Ctrl-A" (code 1) or whatever. This is why keys such as Shift, Alt and so on do not trigger a KeyPress event.
yea thanks guys...
i want to use alt and ctrl in a keyprss event
will it still work ???
yea thanks guys...
i want to use alt and ctrl in a keyprss event
will it still work ???
You can try Key down and key up event using
KeyCode = vbKeyControl ==>> Control
KeyCode = vbKeyMenu ==>> Alt
there you find two perameter for key pressed and shift pressed
I think this will help you.
i want to use alt and ctrl in a keyprss event
Are you sure you can't do it in the KeyDown or KeyUp event?
If you want, you can put code in your KeyPress event procedure to test the current state of these keys. I forget how, but detecting the current state of keys was covered here not too long ago. Maybe a couple of months back. Try some searches.
Hi,
U have to check the Shift in KeyUp event :
Values would be:
A C S
4 2 1 -
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
-
Select Case Shift
-
Case 1
-
MsgBox "Shift Pressed"
-
Case 2
-
MsgBox "Control Pressed"
-
Case 3
-
MsgBox "Shift + Control Pressed"
-
Case 4
-
MsgBox "Alt Pressed"
-
Case 5
-
MsgBox "Alt + Shift Pressed"
-
Case 6
-
MsgBox "Alt+Control Pressed"
-
Case 7
-
MsgBox "Alt+Shift+Control Pressed"
-
End Select
-
End Sub
-
REgards
Veena
There's also an API function you can call to check the current key state. I just don't remember what it's called.
Are you sure you can't do it in the KeyDown or KeyUp event?
If you want, you can put code in your KeyPress event procedure to test the current state of these keys. I forget how, but detecting the current state of keys was covered here not too long ago. Maybe a couple of months back. Try some searches.
or you could just tell me !!! :-) that would be MUCH easer... for me !!! :-)
or you could just tell me !!! :-) that would be MUCH easer... for me !!! :-)
It certainly would. If I could remember it. I do remember it had "Asynch" in the name, but that's probably not a lot of help.
Ok, I spent some time searching, and managed to track down the thread I was thinking of. Here it is.
I hope it's some help.
or you could just tell me !!! :-) that would be MUCH easer... for me !!! :-)
Hi,
did u check my post above...?
Regards
Veena
or you could just tell me !!! :-) that would be MUCH easer... for me !!! :-)
In my first post i wrote what the KeyCode were, and as Killer said, they dont have an ascii code, only a KeyCode. (the keycodes are 17 and 18), and im not sure they'll work in keypress, you should use them in keydown
In my first post i wrote what the KeyCode were, and as Killer said, they dont have an ascii code, only a KeyCode. (the keycodes are 17 and 18), and im not sure they'll work in keypress, you should use them in keydown
Thanks to all of you, but after reading through all that I think we will come to an agreement that space bar (32) will be much easier to deal with
thanks to you all again
sgrec7
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Randell D. |
last post by:
Folks,
I have two related questions:
1. I have seen unicode being mentioned in my javascript pocket book - is
this the same as ascii codes? I think not though I'm not sure and I
can't find...
|
by: chandy |
last post by:
Hi,
I have an Html document that declares that it uses the utf-8 character
set. As this document is editable via a web interface I need to make
sure than high-ascii characters that may be...
|
by: Martín Marconcini |
last post by:
Hello there,
I'm writting (or trying to) a Console Application in C#. I has to be
console.
I remember back in the old days of Cobol (Unisys), Clipper and even Basic,
I used to use a program...
|
by: Kai Bohli |
last post by:
Hi all !
I need to translate a string to Ascii and return a string again. The code below dosen't work for
Ascii (Superset) codes above 127. Any help are greatly appreciated.
protected...
|
by: JSM |
last post by:
Hi,
I am just trying to port an existing simple encryption routine to C#. this
routine simply adds/substracts 10 ascii characters to each character in a
text file (except quotes). The routine...
|
by: Claude Yih |
last post by:
Hi, everyone. I got a question. How can I identify whether a file is a
binary file or an ascii text file? For instance, I wrote a piece of
code and saved as "Test.c". I knew it was an ascii text...
|
by: simchajoy2000 |
last post by:
Hi,
I know what the ASCII Character Codes are for the 2nd and 3rd powers in
VB.NET but I can't find the 6th power anywhere - does anyone know what
it might be or if it even exists?
Joy
|
by: many_years_after |
last post by:
Hi,everyone:
Have you any ideas?
Say whatever you know about this.
thanks.
|
by: Andy Leese |
last post by:
Beginner Question: ASCII Symbols
I am using Borland C++ and programming under DOS. I wish to display the
symbols of the early ASCII character set...
For example:
cout << char(7);
...
|
by: =?Utf-8?B?RGFu?= |
last post by:
I have the following code section that I thought would strip out all the
non-ascii characters from a string after decoding it. Unfortunately the
non-ascii characters are still in the string....
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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,...
|
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...
|
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...
|
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,...
|
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...
| |