I've learned how to use interface to setup macros and I want to able to allow player to enter a cobination of keys to execute verbs. EX ASDF(Spacebar) = nameOfAttack. I was thinking that I could have detectable key combinations setup as macros and then have a proc that checks to see if the executed combinations fit whats in a specific list. I'm not sure whether this is the most effecient way but regardless how would I be able to track what keys or macros a player presses?
If you have a suggestion of a method that would be better to use please don't hesitate to ask.
ID:154696
Jan 15 2012, 12:23 pm
|
|
In response to Mr. Robert
|
|
I'll try it out thanks
|
In response to Raruno
|
|
Edited my post.
|
In response to Mr. Robert
|
|
Thanks again for the help. This along with some of my own adjustments is just what I needed
|
You can use my Keyboard library. It creates macros to manage the state of each key. You'd just have to do this:
client Four keys is a lot to be holding at the same time. Some keyboards won't be able to recognize all of those keys being pressed at the same time. For instance, on my keyboard if I hold down A, S, and D, pressing F won't even be recognized. |
In response to Forum_account
|
|
The amount of keys that can be pressed is both limited by the keyboard maker and the type of keyboard it is. Most PS/2 keyboards can only have two keys pressed at the same time, while most USB keyboards have an unlimited amount on the hardware end, but tend to be limited to three or four keys by the keyboard software/drivers. It is pretty rare to find a non-gaming keyboard with more than three key support. Most will let you use all four arrow keys and three/four standard keys at the same time.
|
Ex;
Then you would need to edit your interface file's Macro list and have A,S,D,F keys execute their corresponding verbs. Ex:
A:
Key - A
Command - keyA
AOff:
Key - A
Command - keyAOff
Check-Mark - When key is released
To go more in-depth, if you want the nameOfAttack() to happen automatically, you would simply put a check in preferably keyF() like so: