Basically want to make a macro script

Israel via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Nov 13 14:20:12 PST 2014


On Thursday, 13 November 2014 at 21:56:48 UTC, Casey wrote:
> On Thursday, 13 November 2014 at 16:04:43 UTC, Adam D. Ruppe 
> wrote:
>> On Thursday, 13 November 2014 at 07:01:08 UTC, Rikki 
>> Cattermole wrote:
>>> I did find this [0]. I don't know what state its in for 
>>> compilating/running ext. But it might give you a good 
>>> starting point.
>>>
>>> [0] https://github.com/pythoneer/XInputSimulator
>>
>> ooh there's some nice code for Linux in there! The Windows is 
>> only half implemented though... but this combined with my 
>> Windows code should get you enough example to write a 
>> cross-platform thing if you need it.
>
> Thank you so much!  I really appreciate this!  But I have a few 
> questions.
>

>
> 2) I can't figure out what the heck half of this code means.  
> It seems that at the bottom you have what each of the hotkey 
> buttons are, and I can see a few times where you referenced 
> them.  I can also see a efw listeners for the keybinds to be 
> pressed, and then where you use the writeln command.  Other 
> than that, I can't tell what's going on.  I feel like a noob, 
> sorry that I don't understand this.
>
> 3) I'm sure that everything you have in there has a meaning, 
> but it looks over complicated to me.  Shouldn't it look 
> something like this?
>
> [code]
> void main() {
>     import std.stdio;
>     import simpledisplay;
>     import *Others that need to be imported*;
>     if (*hotkey command here*) {
>     then writeln ("We're losing Alpha!")
>     return 0;
> }
> [/code]
>
> I know there's a /LOT/ more to it than that, but wouldn't that 
> be the basics?  I honestly don't know a whole lot about what 
> you did, but at least I understand the basic concept of 
> programming.
>
> I'm going to start looking up a few tutorials on compiling 
> using the DM D compiler, let me know if you recommend a 
> different one.
>
> Could you tell me which keys you used for the hotkey in your 
> sample code?  I can't figure it out, but my guess it alt + c?  
> Not sure though.
>
> Thanks again, I am really impressed with you for actually 
> writing the basic concept of it for me!  I can diffidently use 
> this for my building block of learning how to program better!

Well hes basically giving us the core of what we need to create a
binding. Its like hes giving us a car engine and then we build
the rest of it around that.

Except im in the same boat, i cant figure out whats going on. Lol.

Also, the only difference i see with the
-L/SUSBSYSTEM:WINDOWS:5.0 switch is the the program runs with a
command line program in the background. Thats fine i guess.
Unless this does alot of other stuff in the background i dont
understand.

> 1) Which compiler should I use?  I'm attempting to use the DM D 
> comiler, but afaik it doesn't have a GUI and I can't make any 
> sense of how to use it otherwise.  I'll look up a tutorial on 
> it if this is the one you recommend.  If it's not the one you 
> recommend, I'll give yours a try.

The compiler has no GUI. After you install dmd it is then linked
to your system so that you can use it anywhere. It runs as a
background program but you can only run it from another command
line. so Windows Key + R > cmd > click ok > navigate to the
directory where the source code files are with "cd" and "dir"
command line fucntions. Then type "dmd hotkey.d simpledisplay.d
color.d" and the compiler will spit out a hotkey.exe executable.


More information about the Digitalmars-d-learn mailing list