ID:1426153
 
(See the best response by Kaiochao.)
Code:
macro
SHIFT return "keyin \"SHIFT" //DENIED
a return "keyin \"a" //Works great!
SHIFT+A return "keyin \"A" //Lol. Nope.


Maybe one of the staff members can help me out with this, but is there any reference about the proper syntax for DM Script files? If so, what exactly is the syntax for a modifier such as Shift, Ctrl and Alt?

I'm using the macro_mode client variable because I'm trying to use the key by itself. If it's not possible, what's the syntax for adding a modifier to a keystroke; such as, "SHIFT+A" or the like.

I'm trying to soft code a macro system rather than dealing with win*() functions, which is why I'm working with DMS rather than DMF.
I don't recall being able assign macros with Shift and Ctrl or even none of the modifiers. Back when DM Script wasn't deprecated and before 4.0's macro system, the only macros we had were Alt+ macros.

The client.macro_mode variable used to apply to an "Alt" button (players could toggle this mode) on the interface that put ".alt" in the input bar, signifying that any letter pressed would go straight to macros instead of as text in the input bar. This was so players didn't have to hold down Alt for their macros.

There were no Shift+ or Ctrl+ or even Up+ or Down+ macros back then. It follows that the old, deprecated script format does not currently support them.

What do you have against using winset() or the interface editor to set up macros?
I'm trying to put together a keystroke library and being able to soft code the keys would be a lot more useful as far as work is concerned. I'm not sure what the limitations and rules are on using multiple interface files.

That and it just makes my life so much easier. Editing macro's through the interface editor is a pain-in-the-neck at best because there's no option to only edit the macro's or only edit the interface. It's all or nothing and if you have to change the macro's, you have to rebuild the interface as well just to debug it.

It's something that still needs work and I'd really like to see DM Script make a comeback. I think it still has a lot more potential for use if it were just more complete.
In response to Solomn Architect
Best response
What do you mean by "soft code the keys?" What's wrong with winset()?

Forum_account's Keyboard library uses winset() in code to create macros. They apply to all existing macro sets in the interface. By default, the library assigns pretty much every key on your keyboard to key-down and key-up commands.

//  keyboard.dm:192
proc
set_macros()
// this should get us the list of all macro sets that
// are used by all windows in the interface.
var/macros = params2list(winget(src, null, "macro"))
I'll look into winset() a bit further, but past use has been a little dodgy, which is why I try to stay away from it. It does seem unavoidable in this situation, though, seeing as DM Script itself is obsolete by method of incompleteness.

I've never been much of an interface person in the past. Their use has only been a step above verb tabs as far as I'm concerned. Most are just as, if not more ugly. Hence why I never really learned it.

I guess it's just me being obtuse about it. I haven't worked with DM in quite a while and I can already tell I'm pretty rusty.
In response to Solomn Architect
You don't need an interface to use winset() to set macros.

BYOND's default interface has a default macro set, "macro."
Well, I guess that helps a bit. Still, I wish DM Script had more use out of it than style sheets and macros, but I guess the primary language was bound to out perform the scripting language.
In response to Solomn Architect
Solomn Architect wrote:
Well, I guess that helps a bit. Still, I wish DM Script had more use out of it than style sheets and macros, but I guess the primary language was bound to out perform the scripting language.

DMS have one more use - verb alias, that is only really useful in worlds that still use a command line.
Ah, right, Alias'. Well, at least it's styling capacity can still be put to good use, if nothing else.
DMS files have been deprecated since 4.0 was introduced. Their usage is no longer required for anything. Style and macro stuff definitely belongs inside of the interface now.
That's true. But I have no real reason to use the interface anyways. I prefer to create on-map UI's. I think they look prettier. ;)
Using an interface is more than just windows, it makes a lot of things easier like macros and styles, makes them a lot more flexible too. An interface can be as simple as one window with nothing but a map control.
I've never understood people's aversion to interfaces. Doing it all with soft code involves so much guess-and-check... I love being able to see the thing while I am designing it. I mean, would you want to just ditch the map editor, and have to create maps without being able to see the tiles? Or create sprites without seeing the image?

And if you just want to use HUD objects, all you have to do is make a new interface file, stick in a map, and uncheck the window elements that you probably don't want (the status bar, the menu, etc).
In response to Magicsofa
Magicsofa wrote:
I've never understood people's aversion to interfaces. Doing it all with soft code involves so much guess-and-check... I love being able to see the thing while I am designing it. I mean, would you want to just ditch the map editor, and have to create maps without being able to see the tiles? Or create sprites without seeing the image?


It's personal preference. DreamWeaver offers a WYSIWYG, but I personally prefer to just type all my code out in the code editor (I use Notepad++ more than DreamWeaver).
It's a bit different than using a crappy HTML editor, BYOND's interface editor isn't just an afterthought it's an essential part of designing a BYOND game that will meet the current game standards. Sure, you can design your interface using code, but that's not really giving you any advantages.

In the case of DreamWeaver you end up with some terrible HTML as a result of the WYSIWYG editor and you're limited in what you can do more than you would be if using a plain-text HTML editor; in the case of DM you're not left hurting for functionality or with poorly-written code as a result, you're left with a properly designed interface that's a world easier than trying to design it all by hand in the code.

Using the default interface is just poor design though at this point, so regardless of how you design your interface you should definitely not be using the stock interface outside of simple test worlds.
I don't hate the interface editor, and it's certainly not bad or poorly designed. Just as Howey said, it's just my personal preference! :) And I do use the interface just enough to get only the map onto the screen, but I don't use it because, in my personal opinion, getting them to look really good is just a pain. It's easier for me to just do everything via HUD's. This is just my preference though. Other people, of course, will have different opinions.
I'm a fan of map-only interfaces myself, the whole argument here was using dms files instead of using dmf files to their fullest.