Truly puzzling behavior in Soarer's Converter

r_avital

Truly puzzling behavior in Soarer's Converter

Unread post by r_avital » 04 Jan 2019, 02:32

Okay, abandoning my previous thread, because nothing is going to make sense until I get feedback on this question, which should be straightforward and simple (admins, please remove thread at viewtopic.php?f=2&t=20493 if you can, and thank you).

Current headache:

Code: Select all

macroblock
macro F12 
	MAKE LGUI
	DELAY 5
	PRESS L
	BREAK LGUI
endmacro
endblock
This sends the Windows key signal when pressing F12, delays 5 milliseconds, sends an "L" and releases the Windows key. In Win7, this locks the screen and asks for a login, as expected.

Change "macro f12" to "macro F12 LSHIFT" --
Pressing f12 all by itself, and no reaction, as expected. Pressing a straight, human thumb on Left Shift and human Index on actual F12 (no fancy configurable Northgate SF keys involved) -- Nothing but uppercase "L" in the command window or notepad.
So with LSHIFT as a condition to the execution of the macro, the macro executes only "PRESS L". Either that, or the "MAKE LGUI" is executed but ignored for some reason.

What is going on??? This has me running in circles for 2 days now... Sorry, but I haven't been able to find any explanation of this on geekhack or anywhere else that I've searched...

Something else that's weird: I run scaswr empty.sc (empty .sc file), then scinfo, this is the output:

Code: Select all

Protocol Version: v1.00
Code Version: v1.12
Max Settings Version: v1.01
Current Settings Version: v1.01
SRAM Size: 2816 bytes
SRAM Free: 1806 bytes
EEPROM Size: 1024 bytes
EEPROM Free: 1016 bytes
When I scaswr my config file with the code above, with or without "LSHIFT" --the output generated reports "scwr: sending 20 bytes: ok" and no errors, but the following scinfo reports:
EEPROM Size: 1024 bytes
EEPROM Free: 1000 bytes

So before uploading the config, 1016 bytes are available out of 1024 ((seems like 8 bytes are occupied with something), after uploading 20 bytes, 1000 bytes are free, which means only 16 additional bytes were used. Is this normal?

Truly mystified.
Any ideas, anyone?

User avatar
Muirium
µ

Unread post by Muirium » 04 Jan 2019, 05:36

We don’t often remove threads here. Especially those with posts by other users!

Anyway, I’m just on my phone here so can’t offer anything more hands on than general principles. One thing that comes to mind as a possible cause for this particular strangeness is your (unspecificed) keyboard’s [wiki]rollover[/wiki]. Rollover is where keys can be dropped by a keyboard for internal design reasons, usually due to cost cutting on the matrix. Could be that Soarer’s converter isn’t seeing the combo you’ve specified because it just ain’t there.

Try another keyboard. And try another host computer or OS if you can. I wouldn’t put it past Windows to be the cause of this, too.

But above all else, I’d try debugging by throwing in alternate triggers and outputs until I found the underlying pattern. And using an onscreen keyboard to observe what’s going on directly instead of trying to infer it.

User avatar
AJM

Unread post by AJM » 04 Jan 2019, 10:47

I think, that's because you're not sending WIN + L to Windows, but WIN + SHIFT (because you're pressing it) + L.
I can't test it at the moment, but I would program it like this:

Code: Select all

macro F12 LSHIFT
  PUSH_META CLEAR_META LSHIFT
  SET_META LGUI
  PRESS L
  POP_ALL_META
endmacro
edited: I forgot the WIN key ... :roll:

Xubuntu56

Unread post by Xubuntu56 » 04 Jan 2019, 19:39

My code caused me to lose many key functionalities! On my PC/XT, I tried this:

Code: Select all

macroblock 
     macro F6
          MAKE LGUI
     endmacro
endblock 
Problem is, F6 is the only function key that worked. I also lost Enter, Alt, Backspace, and others. So all I had was the WIN key. Any help greatly appreciated.

User avatar
Muirium
µ

Unread post by Muirium » 04 Jan 2019, 20:37

Make = press and no release.

Xubuntu56

Unread post by Xubuntu56 » 04 Jan 2019, 20:47

That's exactly what I wanted--a permanent change. Before, when I tried

Code: Select all

remapblock
    F6 LGUI
endblock
it objected and wouldn't run. By the way, I made other remaps which have worked fine.

User avatar
Muirium
µ

Unread post by Muirium » 04 Jan 2019, 21:21

I think you need to specify which layer when doing a remap. Layer 0 is the default.

Pretty sure you don’t want a key that holds LGUI down forever, once pressed! But it’s possible it is being released once the macro closes, I suppose, without being told explicitly.

Xubuntu56

Unread post by Xubuntu56 » 05 Jan 2019, 00:13

Thanks, Murium! Remapping F6 to LGUI is working fine now; the problem may have been my using an "alternate" spelling of asterisk in the remapblock.

User avatar
Muirium
µ

Unread post by Muirium » 05 Jan 2019, 00:17

Ah yes, the names are important. Some of them always catch me out, as well. Is there an underscore in back_quote? I always have to go check.

r_avital

Unread post by r_avital » 05 Jan 2019, 02:15

Ended up solving the problem using ifselect:

Code: Select all

IFSELECT 1 
	REMAPBLOCK
		RALT	RGUI
		LALT	LGUI
	ENDBLOCK

IFSELECT ANY 
	REMAPBLOCK 
		INSERT	SELECT_1 
	ENDBLOCK
This way, I can press AND RELEASE insert, then left-Alt becomes left-Win, right-Alt is right-Win. Advantage: I'm only pressing one of them + whatever other key is needed for the actual execution of Win+whatever. Disadvantage: both ALT keys stay Win keys until I hit insert again.

Tried it previously with levels, and the advantage and disadvantage are reversed: MUST keep the key that actuates the level down while pressing the key that produces Win, THEN press one or more keys to execute the command behind "Win+whatever" but the layer change goes away as soon as I release the first key that actuated it.

Fine, I can live with the first solution for now. Works perfectly in my Linux environment as well.

For the benefit of any newbie who might get stuck like I was, here's a pretty good tutorial -- just make sure you keep a single command per line:
https://www.reddit.com/r/MechanicalKeyb ... ng_teensy/

Thanks everybody for all your help!

r_avital

Unread post by r_avital » 05 Jan 2019, 02:16

P.S. Do we "mark thread closed" in this forum, and if so, how do I? Thanks.

r_avital

Unread post by r_avital » 05 Jan 2019, 02:23

AJM wrote: I think, that's because you're not sending WIN + L to Windows, but WIN + SHIFT (because you're pressing it) + L.
I can't test it at the moment, but I would program it like this:

Code: Select all

macro F12 LSHIFT
  PUSH_META CLEAR_META LSHIFT
  SET_META LGUI
  PRESS L
  POP_ALL_META
endmacro
edited: I forgot the WIN key ... :roll:
This actually gave: "error at line 2: invalid command"
In any case, I found a different solution.
THANKS!

User avatar
AJM

Unread post by AJM » 05 Jan 2019, 20:12

r_avital wrote: .....
This actually gave: "error at line 2: invalid command"
Well, I didn't repeat the outer macroblock command in my example. If you didn't add it, this error has to be expected.

This is the whole block, which makes exactly, what you were asking in the beginning:

Code: Select all

macroblock
  macro F6 LSHIFT
    PUSH_META CLEAR_META LSHIFT
    SET_META LGUI
    PRESS L
    POP_ALL_META
  endmacro
endblock

Post Reply

Return to “Keyboards”