Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Keyboard methods

Joined
Jul 24, 2014
Messages
188
Can anyone care to explain how you do the following actions to me? I never used this before..

1) Press enter
2) Why is com.runemate.game.api.hybrid.input.Keyboard.Key not accessible?
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
I'm pretty sure to press enter after a string oyu do Keyboard.type("abc", true);
So if you did Keyboard.type("", true); it should just press enter.
But Keyboard.pressKey(Key.KEY_ENTER); is the proper way.
And you're right, the Key enum isn't accessible for some reason. @Cloud
 
Joined
Jul 24, 2014
Messages
188
I'm pretty sure to press enter after a string oyu do Keyboard.type("abc", true);
So if you did Keyboard.type("", true); it should just press enter.
This seems like a bypass/hacky solution lol

But Keyboard.pressKey(Key.KEY_ENTER); is the proper way.
And you're right, the Key enum isn't accessible for some reason. @Cloud

I tried using Keyboard.pressKey(35) as this is the keycode for Enter, but this gives "Unsupported keycode, contact administrator" or something like that.
 
Mod Automation
Joined
Jul 26, 2013
Messages
3,053
@Cloud while you're making the enum accessible could you also revise the error message to be better. For example, "Unsupported keycode. Please contact an administrator."
 
Joined
Jul 24, 2014
Messages
188
@Cloud while you're making the enum accessible could you also revise the error message to be better. For example, "Unsupported keycode. Please contact an administrator."
The error message has proper grammar and is polite if you mean that, I wasn't copy-pasting it ;)
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
I'm not entirely sure if I want to make it accessible, it was meant to be for internal use only.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
I tried using Keyboard.pressKey(35) as this is the keycode for Enter, but this gives "Unsupported keycode, contact administrator" or something like that.
Then how do we fix this issue in a non hacking way?
You're using the API wrong and passing in the wrong values. First of all you should be using typeKey, press and release key are much lower level and using them incorrectly will give you shitty results. Secondly, the keycode for enter is not 35. It is in fact 10 which is reflected by the KeyEvent.VK_ENTER constant in the java API.
 
Joined
Jul 24, 2014
Messages
188
Yore using the API wrong and passing in the wrong values. First of all you should be using typeKey, press and release key are much lower level and using them incorrectly will give you shitty results. Secondly, the keycode for enter is not 35. It is in fact 10 which is reflected by the KeyEvent.VK_ENTER constant in the java API.
Oh I see.. I just googled java keycodes :p
 
Top