geekhack

geekhack Projects => Making Stuff Together! => Topic started by: berserkfan on Sun, 27 July 2014, 07:41:51

Title: short question on soarer programming
Post by: berserkfan on Sun, 27 July 2014, 07:41:51
OK, I'm trying to program a key to do ctrl-shift-t, which in Chrome brings up a formerly closed window.

I can only do ctrl-t.

what's wrong with my code here? I prefer to have both shifts, but couldn't get soarer to accept the SHIFT command so if someone can help with that it's all good.

(note that the key is called pad_5 but could be any other key)

macro pad_5
   PUSH_META CLEAR_META all      
   SET_META ctrl         
   PRESS lshift
   press t            
   POP_META         
   POP_ALL_META
endmacro


Title: Re: short question on soarer programming
Post by: dorkvader on Sun, 27 July 2014, 20:51:17
I would do it like this:
Code: [Select]
macro pad_5
   PUSH_META CLEAR_META all     
   SET_META ctrl         
   SET_META lshift
   PRESS t
   POP_META         
   POP_ALL_META
endmacro

Press sends both down and up, so it was releasing the state on the lshift before t was pressed. So it was pushing and holding the CTRL with the meta command, then pressing and releasing "shift", then pressing and releasing "t". My way uses the same "meta" command to hold down the lshift. I think you can remove the "POP_META" as well.


Another way to do this is with the "MAKE" & "BREAK" commands.

Code: [Select]
macro pad_5
   PUSH_META CLEAR_META all     
   MAKE ctrl         
   MAKE lshift
   PRESS t
   BREAK lshift
   BERAK ctrl       
   POP_ALL_META
endmacro
Pretty sure that will work too. I'm no expert on soarer programming, but it makes sense to me, Let us know if it works for you.

Note this is using the 1.12 (latest) documentation.
Title: Re: short question on soarer programming
Post by: fohat.digs on Mon, 28 July 2014, 10:15:57

Note this is using the 1.2.0 (latest) documentation.


Is this real, or a typo?

I thought that the latest was v 1.12 from about a year ago.
Title: Re: short question on soarer programming
Post by: berserkfan on Mon, 28 July 2014, 10:45:47

Note this is using the 1.2.0 (latest) documentation.


Is this real, or a typo?

I thought that the latest was v 1.12 from about a year ago.

Speaking of which, if I flash all my older teensies with the new version of soarer's code, does that mean I have to compile the .sc and .scb files again and reflash them? Not sure if it's worth it, given my tendency to have computer problems pop up at unexpected times.
Title: Re: short question on soarer programming
Post by: dorkvader on Mon, 28 July 2014, 17:30:13

Note this is using the 1.2.0 (latest) documentation.


Is this real, or a typo?

I thought that the latest was v 1.12 from about a year ago.


typo, now fixed. Thanks.

Speaking of which, if I flash all my older teensies with the new version of soarer's code, does that mean I have to compile the .sc and .scb files again and reflash them? Not sure if it's worth it, given my tendency to have computer problems pop up at unexpected times.
if you re-flash the teensy, I believe all you'll need to do is "write" the layout to it again. It takes a lot more time to write the teensy than run a scaswr <file> in my opinion. I also keep all my KB layouts in c:\kb so it's easy to get to.

That said, I believe this functionality has been part of soarer's FW for a while, so even if you don't update, it'll probably still work. You can check the documentation you have to see if the commands are there.