Ashwin.Star Posted May 30, 2013 Share Posted May 30, 2013 Hi Guys, I am making some Tools, Which will let us Modify the Data of Files like Carcols.dat, etc. during game play so that we could Observe Which Value Shows Better effect & what effect. So, I want to know ! What will make my Tool to get which Key is Pressed by user in The Game, BCuz VB events like Key Down or Pressed Works only when form is in Focus, Waiting for the Help ... //<-- And Pls, Don't do that "no reply" thing Again -->// Link to comment Share on other sites More sharing options...
Ashwin.Star Posted May 30, 2013 Author Share Posted May 30, 2013 (edited) <--- Solved ---> Finally got it, The thing i was looking for is known as "Hot key", I'm very sorry if you feel i wasted your Time, <--Added--> this is what need to done for it add a timer to your form, lets say timer1 & add the following lines to your code Public Class Form1 Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer Dim result As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Interval = 1 Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick result = GetAsyncKeyState(Keys.Back) ' or can be written as 8 (Backspace), Vkey If result = 0 Then GoTo ext Else Timer1.Stop()'Here is what to do if that key is Pressed ''example this message MsgBox("Backspace") End Ifext: Timer1.Start() End SubEnd Class Edited May 31, 2013 by Ashwin the new boy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now