Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Change Actionkey in the code


TGSlp
 Share

Recommended Posts

Hey.

I want to change the actionkey (Default CTRL) in the code to space. But i cant find it in vb6.

Where in the code can i change it? I searched for Actionkey, CTRL, Control and so on..

Hope someone could help me :)

Regards, Rene
Link to comment
Share on other sites

In your client, go into modInputs, and find Sub CheckKeys

You'll see it'll say If GetAsyncKeyState(VK_CONTROL) >= 0 Then ControlDown = False.

There are 2 ways to resolve this issue, you can 1\. Change the value of VK_CONTROL itself or 2\. Replace it with VK_SPACE and then we'll define what VK_SPACE is.  That being said. I'll give you the code for both.

Method 1\. (Changing VK_CONTROL's value to the spacebar)

>! Go into modConstants, find Public Const VK_CONTROL As Long = &H11 and replace it with Public Const VK_CONTROL as long = &H20

Method 2\. (Changing GetAsyncKeyState to VK_SPACE)

>! In modConstants, find where it declares all the other keys, like VK_CONTROL, VK_RETURN etc, and add in
>! ```
Public Const VK_SPACE = &H20
>! ```

>! Go into modInputs, Sub CheckKeys, change VK_CONTROL at the top to VK_SPACE
Link to comment
Share on other sites

  • 1 year later...
I believe that if you use the method of creating the new constant (Public Const VK_SPACE = &H20) you'd have to change the section where it uses that constant (getAsyncKeyState(CONSTANTHERE)) to use VK_SPACE instead of VK_CONTROL aswell. Also, shouldn't VK_SPACE be declared as a long as well if it's the same type of constant?
Correct me if I'm wrong.

-Seal
Link to comment
Share on other sites

What's different between using GetKeyState and GetAsyncKeyState ?

I always use GetKeyState because it's easy to use.. you don't have to set the variable of the key and just input it as vbKeyControl like

If GetKeyState(vbKeyControl) < 0 then CtrlDown = true

vbKeyControl is on the syntax itself, you don't have to add a constant for it.

Question: What's the difference between them? Speed?
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...