Remapping keys that send multiple codes with Soarer's converter.

User avatar
VincentStrand

03 Jul 2023, 21:29

I just finished making a Soarer's converter to use with my Wang 724 keyboard but when I went to remap some of the keys I saw that all of the non-standard keys are sending a left alt press. Using hid_listen I saw that the Cancel button on the keyboard sends +E2 +40 -40 -E2 which I assume to mean that it is registering as pressing left alt + f7. My question is how do I remap these in a way that all of the non-standard keys are distinguishable from one another. I am on Linux if that affects anything.

User avatar
Muirium
µ

03 Jul 2023, 23:02

Read Soarer’s documentation on macro commands. They’ll do the trick. You can remap from these specific combos to whatever keys you actually want.

User avatar
VincentStrand

04 Jul 2023, 05:51

Thank you for the reply I tried it out but it seems like the scas program requires non modifiers to come first on the macro line so it failed to compile. This is the code I tried to use since the keyboard sends the keys in that order but the output of the command is "error at line 2: invalid argument". Is there any way to get around this requirement for the macros?

macroblock
macro LALT F9
press A
endmacro
endblock

User avatar
Muirium
µ

04 Jul 2023, 10:43

No. Irritatingly, all I can say is that you're understanding it wrong. Sorry. ;)

Macros define events that happen the instant BOTH keys are pressed. The sequence doesn't matter. You can be holding F9 then press LALT and only when both keys are down does the macro's condition turn true and it is run. They describe a state.

Take a look at a few macros other people have done, to get a feel for the syntax. I'll dig up my own big config which has plenty of examples. What you're trying to do should be very easy, once you've got the syntax.

Here's the full multi-keyboard config. I've pulled out just one group of macros here:

Code: Select all

	# Transform ralt into HHKB function key, with each of the standard navs

	macro semicolon ralt -lalt -gui -ctrl
		push_meta clear_meta all
		press left
		pop_all_meta
	endmacro

	macro quote ralt -lalt -gui -ctrl
		push_meta clear_meta all
		press right
		pop_all_meta
	endmacro

	macro left_brace ralt -lalt -gui -ctrl
		push_meta clear_meta all
		press up
		pop_all_meta
	endmacro

	macro slash ralt -lalt -gui -ctrl
		push_meta clear_meta all
		press down
		pop_all_meta
	endmacro
	
	macro l ralt -lalt -gui -ctrl
		push_meta clear_meta all
		press page_up
		pop_all_meta
	endmacro

	macro period ralt -lalt -gui -ctrl
		push_meta clear_meta all
		press page_down
		pop_all_meta
	endmacro

	macro k ralt -lalt -gui -ctrl
		push_meta clear_meta all
		press home
		pop_all_meta
	endmacro

	macro comma ralt -lalt -gui -ctrl
		push_meta clear_meta all
		press end
		pop_all_meta
	endmacro
endblock
There's a bunch going on here in the triggers: the opening line of each macro. They spell out the state of all the modifier keys that macro wants. You don't have to be so specific, but Soarer's very flexible so you can.

Modifiers are special. Soarer lets you treat them just like other keys, but when necessary you can store them.

What I’m doing next is storing the state of all the modifier keys (push_meta) then clearing them (clear_meta all), sending the simple keystrokes that I want, and restoring the modifiers back again (pop_all_meta) when I’m done. Macros fire *instantly* so the computer sees a rapid flick of the modifier keys and you're done.

In your case: I'd focus on the first line—the trigger—of these macros. Pushing and popping modifiers may not even be necessary with your Wang's extra keys. You'll know it when you need it.

User avatar
VincentStrand

05 Jul 2023, 06:02

Wow I guess I completely misread that part in the docs thank you. I had tried it the other way around but assumed it was not working because I did not push and pop the modifiers. Working perfectly now.

User avatar
Muirium
µ

05 Jul 2023, 10:33

You're welcome. I remember learning Soarer's ten years ago by trial and error and assistance from the man himself. Since then I've just adapted my existing rules for the most part, which makes things very easy indeed.

I did finally get around to learning how to use the 'set' functionality though, to switch between whole layouts entirely. The trick was to find someone else's working config and experiment with scas from there. ;)

Post Reply

Return to “Keyboards”