I'm trying to figure out how I can call Northeast(), rather than just North() or East(), when both the up and right keys are held. Either that, or finding out if the Up key is being held, and the Right key is being held, and adjust to that.
The Key_State resource goes over it, but it also goes over my head. It talks quite a bit about creating the macros dynamically, but I really only need the macros/procs to be called for a couple of hardcoded keys. How do I go about this?
ID:155633
Apr 28 2011, 5:32 pm
|
|
In response to Lummox JR
|
|
Thank you very much. Playing with macros is very new to me. I've also learned turning "control_freak" on helps quite a bit, eheh.
|
In response to SqueakyReaper
|
|
I've got another question, if that's alright.
macro west return "move -1 0" east return "move 1 0" north return "move 0 1" south return "move 0 -1" Simple enough to define macros like that. My question though is how would I make it so there's a macro for when a key is done being held? In .dmf files we can define "West+UP", but how would we do that in a .dms file? |
In response to SqueakyReaper
|
|
The .dms is pretty much depreciated at this point since a .dmf can accomplish everything the .dms could do and much, much more.
|
In response to LordAndrew
|
|
Curses. I type a lot faster than I navigate menus, and I'm more comfortable with copying/pasting code over. Is there no way to define macros like these at run-time, or should I just go with the .dmf?
|
In response to SqueakyReaper
|
|
According to the skin reference, macros can indeed be created at runtime.
winset(usr, "myCtrlEmacro", "parent=macro1;name=Ctrl+E;command=exit") This is an example it gives of creating them. |
In response to LordAndrew
|
|
Wasn't quite able to make sense of that. I suppose I can always just use the .dmf file, eheh.
|
In response to SqueakyReaper
|
|
Bah. Why was the .dms file depreciated, anywho? It seems really easy to just go "macro/s return "blah 1 0" rather than fiddle with interface files. xD
Oh well. A lot of "simple key handling" libs aren't so simple, and there's a lot of mess everywhere when it comes to code. Upsetting. |
For your macros, you would define them like so:
North: .dir 1 0
North+UP: .dir 0 1
South: .dir 2 0
South+UP: .dir 0 2
East: .dir 4 0
East+UP: .dir 0 4
West: .dir 8 0
West+UP: .dir 0 8