Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help on ActiveX control of Key board..

Status
Not open for further replies.

smartsarath2003

Member level 4
Member level 4
Joined
Feb 12, 2004
Messages
77
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
1,061
Hai,
Can anyone help me with activeX controls basics. I am trying to create a activex automation for a programming software. Is it possible to create some keystrokes, say ALT+F, DownArrow and then ENTER by creating a C function or by accessing an existing function . Is it possible to do that? I was able to open my programming software, by calling .EXE file. Here I am trying to automate the total programming prodedure by simply executing a code module. can anyone help me to implement some false key board strokes

Thanks
 

yes it is.. but i don't think it's activeX?
anyways it's something that i use in my game i've made Lands of Crom
i'll load up vb6 and get you the code.

Private Declare Function GetAsyncKeyState Lib "user32" _
(ByVal vKey As KeyCodeConstants) As Long
Private Function KeyDown(ByVal vKey As KeyCodeConstants) _
As Boolean
KeyDown = GetAsyncKeyState(vKey) And &H8000
End Function

Private Sub Timer1_Timer()
If KeyDown(vbKeyN) Then Form1.NewGame
If KeyDown(vbKeyS) Then Form1.Story
If KeyDown(vbKeyI) Then Form1.Instructions
If KeyDown(vbKeyC) Then Form1.Credits
If KeyDown(vbKeyE) Then Form1.Register
If KeyDown(vbKeyL) Then Form1.LoadGame
If KeyDown(vbKeyH) Then Form1.High
If KeyDown(vbKeyR) Then Form1.ResumePlay
If KeyDown(vbKeyV) Then Form1.Version
If KeyDown(vbKeyQ) Then Form1.QuitGame
End Sub
Sub QuitGame()
Form1.Hide
Form1.Timer1.Interval = 0
Form3.Show
End Sub
Private Sub Command1_Click()
Form1.QuitGame
End Sub
Sub ResumePlay()
If Form13.Text17 = 1 Then Form1.Timer1.Interval = 0
If Form13.Text17 = 1 Then Form2.Timer2.Interval = 80
Rem If Form30.Text35 = 1 Then If Form30.Text33 = 0 Then Form9.OLE5.DoVerb
Rem Form30.Text33 = 1
If Form13.Text17 = 1 Then Form1.Hide
If Form13.Text17 = 1 Then Form2.Show
Rem If Form13.Text17 = 0 Then Form1.Hide
Rem If Form13.Text17 = 0 Then Form5.Show
End Sub

anyways hope you can understand that :) you gotta like link up a timer to the keyboard to grab what you say.. but it gets timed at like a rate... just sometimes u press a key for longer than 1ms :) so that's why i have it 80, and 0 is turning it off.

If you'd like to be nice and donate some points i'd be very greatful and hope this is what you want.

and remember "Lands of Crom" :)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top