Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Global Events For Keyboard SCAN CODE & ASCII CODE Event Trapping?


OK, don't be mad at me, if this is a stupid question, but I'm quite new to VB, so here's my Q:
Is there any global event (not KeyUp/KeyDown/KeyPress) to trap keyboard keypresses with SCAN codes? It is very important to have the exact scan code. I want to use an API function to simulate the pressed keys on an other machine, and I need to have the scan code. By the way, API function calls won't do it for me, I need an EVENT! (I don't want to call functions over and over again e.g. in a timer event. This is too -slow-)
So if anyone out there can help me, please do!
You won't regret it!

Thanks to all....




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Get AT Keyboard Scan Code
How do I get the raw scan codes send by AT keyboard in VB? Is there any API for doing this?

Trapping Keyboard Events
I am attempting to trap a CTRL + F and turn that into a ALT + F. Below is my code however, the sendkeys function does not work for some reason. Any ideas as to why it does not work?

Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If GetAsyncKeyState(vbKeyControl) And GetAsyncKeyState(vbKeyF) Then
      frmMdiGlobal.SetFocus
      SendKeys "%(f)", True
End If




I am detecting the key combinations. The form does get the focus but the SendKeys portion does not work.



Edited by - cmc on 8/27/2004 6:38:56 AM

Trapping Keyboard Events
Hi

I am working on an desktop application and my requirements are to trap Keyboard inputs like ATL+0 etc. I have to ensure that :

1. The keyboard inputs are trapped even if the Desktop application is inactive (in a minimised state and residing in the trap only)
2. Combination sets of ALT + 0 etc have to be trapped and some fucntionality be executed.
3. Not use DirectX

I have been able to do so using directx but then directx8 is not supported by NT 4.0.

Thank you in advance.

Regards

Key Press Event And Ascii Code In Unicode Environment
As part of internationalizing an existing VB application such that it supports Japanese, Korean, Chinese (i.e. all Unicode characters) not only English language.

The problem we are expecting is, in the current English version, we are having some key press events like

If KeyAscii = 64 Then
blnResult = False
'Do some thing here …
End If

Actually the above code takes the ASCII code (say character ‘A’) from the end user and doing some operation. How do we consider the same in Unicode version (i.e. in the Japanese version, the end user will enter his own character not ‘A’ as in this case)? Is there any standard methods/solutions are there while internationalizing an Application for these key press events? Please let me know.

Generate An Ascii Code From Vb Code And Vise Versa
hello,
i working in a project where i should read ascii code using the vb to generate the result on excel and vise versa, generate the ascii code using vb

any one have already did this?

thanks for the help

How To Convert Binary Code To Ascii Code
Does anyone know how to convert binary file to text file

Help Me Code Scan Ip
i want code scan ip
please....

How To Get Then Scan Code Value Of Key ?
Hi all !

I want to know if its possible to get the scan code value when a key is press on the keyboard in visual basic. The KeyDown or KeyPress message doesn't provide the information is there another way ? I know the OnKeyDown Message in win32 using VC++ provide such information but where can i find it in VB ??

Thanx
Charles

How To Retrieve Scan Code From VB?
Hi,

Does anybody know how to retrieve scan code for a key press in VB?

My requirement is if user presses a key, I have to display that key in a text box.

For keys like F1 etc. I need to get SCAN Code, as it doesn't have a ASCII code.

Pls. help me.

Thanks,
Sateesh.

Scan A Page Using Code
how to scan a page using VB?
(controlling the scanner thru code)

Key Scan Code To Launch Application
hi sorry if this is a silly question but i am new to vb, i am trying to wright an app to launch a .exe when one of the custom buttons is pressed on my dell insperon 8100 dell provide an application to do this but you can only customise 2 of the 4 buttons and id realy like to be able to customise all 4. looking at the dell program i get what i think are the button scan codes from the registory (e001 to e004) but i am unshure how to right them into an app the closist i have is this:
If GetAsyncKeyState(vbKeyQ) Then
Shell ("C:Program FilesMicrosoft Visual StudioVB98vb6.exe")
End If
but i am unshure how to change the key as its a non standard key i need to put the scan code in rather than a difrent vbkey

thanks for your help

Object Missing = Code Inside ...scan It Forever =[
Im sirrting aginst that code for 60min and its 8:00 am and i dident sleep =
i cant find what wrong!?@
its says object missing ....and highlight that
"Set Label.Container = Picturebox1"

Code:
Private Sub Form_Load()
Dim Picutrebox As PictureBox
'make the form pixels for easier drawing... doesn't have to be though
Me.ScaleMode = vbPixels

'draw picturebox
Set PictureBox = Me.Controls.Add("VB.Picturebox", "Picturebox1")
With PictureBox

.Left = 1080 + 255 * 1
.Top = 5040
.Width = 500 * 2
.Height = 500 * 2
.Visible = True
.BackColor = &H8000000F
End With
Dim Label As Label
Set Label = Me.Controls.Add("VB.Label", "CMLabel1")

Set Label.Container = Picturebox1
With Label
.Left = 0
.Top = 0
.Width = 500
.Height = 500
.Enabled = False
.Visible = True
.Caption = "345 X 345"

End With
End Sub

and ... is it possible to check if ther is internet connection on the computer?
which includes routers

Trapping Code? If Statement
Okay so this is my code that I've got set up.

Code:
Private Sub cmdCreate_Click()
txtresults.Text = "<TITLE>" & txtTitle.Text & "</TITLE>" & vbCrLf & "<META NAME=""AUTHOR"" CONTENT=""" & txtAuthor & """>" & vbCrLf & "<META NAME=""DESCRIPTION"" CONTENT=""" & txtDescription & """>" & vbCrLf & "<META NAME=""KEYWORDS"" CONTENT=""" & txtKeywords & """>"
If txtTitle.Text = "" Then
txtresults.Text = ""
End If
If txtTitle.Text = "" Then
MsgBox "You need to fill in all of the fields"
End If
If txtAuthor.Text = "" Then
txtresults.Text = ""
End If
If txtAuthor.Text = "" Then
MsgBox "You need to fill in all of the fields"
End If
If txtDescription.Text = "" Then
txtresults.Text = ""
End If
If txtDescription.Text = "" Then
MsgBox "You need to fill in all of the fields"
End If
If txtKeywords.Text = "" Then
txtresults.Text = ""
End If
If txtKeywords.Text = "" Then
MsgBox "You need to fill in all of the fields"
End If
End Sub

It works: if you don't fill in all the boxes you get an error and the text box will stay blank. But if you don't fill in more than one it gives you my error message(msgbox) more than once. Which makes sense seeing as I've got it typed in so many times. I guess my problem is, I don't know how to put more than one statement into an IF statement.

"School Project thread"

Code Trapping Error
My add movie form has many fields and NOT all are compulsory to be entered except title and movieID. The rest are optional. When I run my code after filling all controls, the records get inseted into the DB. If i leave out some of the fields on the form, then i get an error indicating that some fields were not filled.

How can i allow some fields to be left blank and still get the entered data captured in the DB?

Code Needed For Excel To Scan Column C If Value &gt;0 Then Copy Row Into New Sheet
I need help creating a proposal work sheet in excel. Where user enters value in column c if they want to select the row. I want them to hit the "calculate" button and the macro search column C for a value greater than 0. If>0 then copy row into row of new sheet 'quote'. The sheet 'quote' is formatted to resemble letterhead and will be printed out so the copied in rows should begin at row 15. Any help is appreciated I am a complete novice at this. thanks

Slow File Load Time...scan Code Question
Hello

I am working on a small app to load *.tga images. I need to get byte level info from the various format fields contained within the image.

I'm reading the file into an array called imagearray() but it seems to take WAY TOO LONG to scan it in. Is my selection of code appropriate? Do you know of a better way?

code...

.............................................................................

Open FilePathandName For Binary Access Read As filenumber

For filescan = 1 To filesize
Get filenumber, filescan, imagearray(filescan - 1)
Next

.............................................................................
For a 250k file this takes ages ~ 10 secs.

Best regards

Alex

I Keep Reusing The Same Error Trapping Code...
Can I put it into the module and make it a function so I can access it whenever I need it?

ASCII Code
does anyone know what the ASCII code for spacebar and enter is?
Thanks

ASCII Code
I'm trying to get the application to display the word that the user enters in a text box in ASCII .. but it's only displaying the first letter in the word .. how can I get it to display each character?

Is There An Ascii Code For Nothing?
ie if

sTest= ""
msgbox chr(sTest)

I would get an error, so does that mean there isnt one?

Ascii Code
Just looking for the ascii code for the back, forth, up and down arrows if there is any. I can't seem to locate them. any help would be appreciated.

Ascii Code
Do you know which Ascii codes represent the up, down, left and right arrows and also "Tab"? I need them for use with a grid.

&lt;&gt;&lt;

Ascii Code
Does Anyone have an Ascii converter(from normalkeyto Ascii) or a chart that I can view?

ASCII Code
Ok I know what function to use and have it show a letter as a number in a label, but how do you get it to show multiple letters as numbers.

Example: user types in the text box "Example"

the label would display : E=number X=number A=Number etc.


also another program im trying to code I need help with as well.

You click the command button and a input box comes up (I know how to code a input box) and the user types a # of words they will use to create a acronym, after that new input boxs come up for the amount they typed.

then those two words will creat a Acronym

example : Two words are Jack Lone, the label will have the first letter of both words displaying JL.

any help will be great thanks.

ASCII Code
can someone show me some code to create the ASCII thing, please

How To Get The Ascii Code For A Key.
how to get the ascii code for a key.

Ascii Code For Alt+tab
hi does anyone know the ascii for alt+tab? or at the least for alt?

Fix Ascii Code
if KeyAscii <> 13 Then
lblMessage.Visible = True
lblMessage.Caption = "Enter Expires Date:"
end if
if KeyAscii <> 13 Then
lblMessage.Visible = True
lblMessage.Caption = "Enter I.D. Number:"
end if
if KeyAscii <> 13 Then
lblMessage.Visible = True
lblMessage.Caption = "Enter Check Receipt:"
end if

so it will goto the next question

ASCII Code
Does anyone know what the ASCII codes for the function keys are? (i.e. F1, F2, F3 ...) and the codes for Ctrl, Alt, and Shift?

ASCII Code
Alrighty...

I know how to get the ASCII code of a character in VB, but does anyone know how to do it in Java?..

Ascii Code
Sups,
I need to know what is the ascii code of the up and down arrays?

Ascii Code?
Ascii code for bold stick "|" equivalent to null???

note: Not Alt 124, [Bold 124]

% ASCII Code?
Anyone know the ASCII KeyCode Constant for %

ASCII Code
Anyone happen to know the ASCII code for a check mark?

Thanks

Is There An ASCII Code For..
Hi, just wondering if there are ASCII codes for the UP, Left, Right and Down arrows on the keyboard, and if so, what are they?

Thanx

Scott

Ascii Code
does any one have a ascii code chart or just the ascii code for del please someone help

Ascii Code
where can i get asci code characters
of key_press even...i want ascii code of every key on my key board

Emulating A Keyboard Button(VB Help Relating To Keyboard Events)
Hi There,

Does anybody know of a way to make the computer think as though a button has been pressed on the keyboard?
e.g. the user press's the delete command button on my form and it sends a message to the computer thinking that the delete key has been pressed.

Any help would be greatly appreciated!

Thanks.

Global Application Code?
Is there someway to attach a macro to the excel app rather than just an individual workbook so that you could use it no matter what workbook was open?

Ascii Key Code For The Arrows
does ne one have the ascii character code for the arrow keys
PLease help

Ascii Code Into Characters
Hey all.
i am an UBER n00b at this site and to Visual Basic. Currently i am taking a visual basc class at school but that leaves a LOT to be desired. ok here is my delima, don't laugh, its extremely n00bish:

I have a program to take a string and display it in its ascii code. This part was fairly easy but now i want to have the program convert a string of ascii code into characters forming a message. This is the code for the encoding part of my prog:

Private Sub optEncode_Click()
Dim strMessage As String
Dim I As Integer 'index for next loop statement
Dim strChar As String
Dim strAscii As String 'the ascii code to be displayed
Dim intLen As Integer 'number of characters

strMessage = InputBox("Enter message for encoding", "Please Type Message")
intLen = Len(strMessage)
For I = 1 To intLen
strChar = Mid(strMessage, I, 1)
strAscii = strAscii & " " & Asc(strChar)
Next I
lblDisplay.Caption = strAscii

End Sub

Pretty straight forward. i want to use a similar code to "decode" ascii the problem is i don't know how i would distinguish between character codes within the string as some are 2 digit and other 3, etc. Pleaze help this n00b!

Ascii Code For Numbers???
On my program i have the ascii code for just letters which is:
8, 9, 32, 65 To 90, 97 To 122

does anyone know what the numbers are so that only numbers can be typed in? would it be all the numbers that arnt on the list above or would some of them numbers be for special characters liek £ and $ sign etc???

cheers

Checking For Ascii Code
hey all,

How can I make my VB detect whether a textbox contains valid ascii characters or not?

Thanks for reading

ASCII Code Help - VBS Program
I have a program that needs to convert the 'phrases' entered by user, and convert it into ASCII code, and add '2' to the ASCII number and change it back from the new ASCII number to a letter character. So this is basically a code encrypter.

Example:

I enter "ABC DEF G" in text box
change "ABC DEF G" into ASCII Code
"ABC DEG H" = "65 66 67 68 69 70 71" in ASCII code
Then, I add 2 to each of the numbers.
"67 68 69 70 71 72 73"
Then convert it back to letters characters again
"CDE FGH I"

So it goes from "ABC DEF G" to "CDE FGH I"

Heres the code:


Code:
Private_Sub click (Command1)
text1= text1.text
For intNum = 1 to Len(text1)
intCounter = intCounter + 1
intJum = mid$(text1,intCounter)
intDum = Asc(intJum)
intBum = intDum +2
intCrum= chr$(intBum)
Print intCrum;
Next intNum

' This loops and gets every single letter character and converts it to ASCII , then adds 2, then converts it back again.

I use Len(text1) for the number of characters of each sentence
This code works, but how do I make it so that if I type:

"HELLO THERE"

It would be:

"JGNNQ VJGTG"

instead of:

"JGNNQ"VJGTG"

Because when I press [space], space is a character too, so it adds 2 to [space] number, which prints double quotation marks.

How do I make it so it keeps the space in the sentence, and not make " appear for [space]?
The code works, but

Getting A Char From It's ASCII Code
Hi
I'm writing a function to create random strings and I do something like

string = string + Chr(random_ascii_value)

It works to some extent but not exactely as I expect it to.
It only generates upper chars and simbols like : ; > =
The random_ascii_vaule is in fact at least 97 (ASCII code for 'a') and at most 97 + 24 ('z' I think).
Does this has to do with 2 bytes strings (unicode?) or what?
So how can I generate the plain char for a ASCII value if CHR doesn't do that?
Thanks

ASCII To Vitual Key Code
Im tring to send text in a text box using the keybd_event but I need to convert the ASCII code to a virtual key code. numbers pass just fine but im haveing trouble with text. here is what I have.

If GetForegroundWindow = FindWindow(vbNullString, "Untitled - Notepad") Then
For I = 1 To Len(txtSend.Text)
keybd_event Asc(Mid(txtSend.Text, I, 1)), 0, KEYEVENTF_KEYUP, 0
Next
End If

Ascii Code For Down Arrow
Hello guys!
can anyone please tell me what is the ascii code for the down arrow, or how i can block it in a program¿

Thanx..

Simple Ascii Code .
Hi , does anyone know the ascii code for ESC ??

Thank.

What Is The ASCII Code For Bkspc And Del?
Hey there-
Anyone know what the ASCII code is for delete or the backspace?

Thanks
Laura

Copyright © 2005-08 www.BigResource.com, All rights reserved