Help reassigning keys with Soarer

r_avital

Help reassigning keys with Soarer

Unread post by r_avital » 30 Dec 2018, 01:34

Hello all,
I'm a former programmer, but confess I have had very little exposure to programming hardware such as keyboards. Apologies in advance for my dorkiness and incorrect terminology.

I have an Omnikey Ultra (with the extra "OMNI" key on the navigation pad). What I'm trying to accomplish:
This keyboard has a row of additional Function keys F1-F12) across the top, in addition to function keys on the left side. The row across the top, the keys are labeled "SF1-SF12" and by default, upon booting, they function as Shift+F1 through Shift+F12.

There is a key labeled "SF Select" which allows me, say, after I press it, to press left-Alt, and from that point on, all the SF keys are Alt+F1 through Alt+f12. The problem is, this is not persistent, and you have to do it every single time you boot up, and every single time you switch from one PC through another on your KVM. Naturally, in all testing/programming, I connect directly to a PC to eliminate the KVM issue.

I have a Soarer cable, and I have some understanding of the remapblock-endblock structure in a config (.sc) file. Problem is, all examples I've seen remap a key to a single key, not to a key-combination. Also, I'm not sure how to refer to the "input key" (in this case SF1) before I assign Alt+F1 to it.
Is this something that requires a macro? A layer? As you can see, I'm confused.

Also, I've used the Soarer hid_listen.exe utility and can identify key-names corresponding to hid_listen's keycodes on Soarer's code documentation. What worries me here is:

"srtaight" unmodified F1 (on the left side gives:
^[OPr05 +3A d3A <--- (I suspect the first 3 characters are garbage)
rF0 r05 -3A u3A

SF1 key (after all SF keys have been set to ALT+SF using the "SF Select" key):
r11 +E2 dE2 r05 +3A d3A
rF0 r11 -E2 uE2 rF0 r05 -3A u3A

So in both cases, "3A" (according to Soarer's "code" documentation) is F1, though the second one has additional preceding codes, which I could not find on Soarer's code doc.
So how to refer correctly to the key that I press?

If anyone has done this or something similar, I would be grateful for an example that I can get to work on.

Thanks in advance, and Happy New Year!

User avatar
Muirium
µ

Unread post by Muirium » 30 Dec 2018, 08:02

Well, I don’t have the full answer. But I can point you toward macros for the one key => two keys output you seek. Macros look for a trigger condition, and then fire whatever sequence of mods and keystrokes you specify. In your case, you want all those function keys to be given an Alt on the side. It’s a bit inelegant but I’d manually specify the lot of them as macros, adding lalt or ralt as you desire. Something like this:

Code: Select all

macroblock
	# F1 = lalt + F1
	macro f1 -shift -alt
	push_meta set_meta lalt
	press F1
	pop_meta
	endmacro
endblock
Untested. This might need some tweaking. You may get two F1 presses out of it, for example. Fortunately, trial and error is pretty simple with Soarer.

Note the line starting with “macro f1” that’s the trigger condition. I threw in a -shift and -alt which means this macro would not fire if you’re holding either of those when you hit F1. Tricks like that can be very useful.

Subsequent macros fit inside the macroblock. Only use endblock to finish the whole lot.

Now the bit where I’m not helpful: the fact your keyboard has two sets of function keys. I don’t know how to tell them apart with Soarer’s. Someone else might. In the meantime, play with macros and learn their tricks.

r_avital

Unread post by r_avital » 30 Dec 2018, 10:37

Thanks, that's definitely helpful, I'll start with this. As far as trial/error, how do I undo the programming? Upload an empty .sc file?

User avatar
Muirium
µ

Unread post by Muirium » 30 Dec 2018, 16:03

Correct. I have an empty text file called null.sc whose scas output I use to blank out my dead ends, by simply issuing the command: “scwr null”. I’m on Mac so unix style commandline, you’ll need scas.exe etc. naturally.

I don’t often have to nuke and pave, however. Because what Soarer’s converter is really up to is always based on that blank, default state. Everything we specify in our config files is added on top of that foundation. Q = Q, W = W, etc. until defined otherwise. So it’s pretty easy to fiddle around in your own thing one line at a time instead of burning down the lot.

r_avital

Unread post by r_avital » 31 Dec 2018, 01:28

Many thanks, Muirium, I see the advantage in that, rather than nuking/repaving. This will keep me busy for a bit.

Xubuntu56

Unread post by Xubuntu56 » 31 Dec 2018, 16:31

@Muirium
Could you please help me straighten out my code? I would like for CAPS_LOCK to act as a "Firefox-Back" button.

Code: Select all

# make CAPS_LOCK act as "Firefox-Back" button
macroblock
macro CAPS_LOCK
push_meta
press LALT
press LEFT
pop_meta
endmacro
endblock

User avatar
Muirium
µ

Unread post by Muirium » 31 Dec 2018, 20:49

Modifier keys are treated a little different to the rest. Instead of “press” you want to push and set meta then pop them off once you’re done. The example I posted earlier has that at work. The only key you want to “press” will be “left”.

I also think there may be a browser history key deeper down in the available USB codes list, not that I’ve never used it.

Xubuntu56

Re: Help reassigning keys with Soarer

Unread post by Xubuntu56 » 08 Jan 2019, 22:09

This works, but is there a "cleaner" way to do it? Kb is PC/XT.

Code: Select all

ifset set1
layerblock
	FN1 1
endblock
remapblock
layer 0
	F1 FN1
endblock
remapblock
ifset any
layer 1
	1 F1
endblock
I've got F1 initiating layer 1, and the normal F1 function resulting from 'F1+1'.

User avatar
Muirium
µ

Re: Help reassigning keys with Soarer

Unread post by Muirium » 08 Jan 2019, 22:23

Cleaner way to do what, exactly?

Xubuntu56

Re: Help reassigning keys with Soarer

Unread post by Xubuntu56 » 08 Jan 2019, 22:37

Using F1 for the layer, then having to create a new F1. Perhaps it's necessary due to the XT not having a Fn key?

User avatar
Muirium
µ

Re: Help reassigning keys with Soarer

Unread post by Muirium » 08 Jan 2019, 23:20

I like to use the ideally placed little key immediately right of right shift as my fn. Fun fact: the XT is where I learned the HHKB arrow layer; which I use every day since!

This might not be as ideal for you, though. But I don’t need a lot of those PC centric keys, and I’ve quite forgotten what they even are. My XT layout seems more natural in my head than the keys original legends.

Xubuntu56

Re: Help reassigning keys with Soarer

Unread post by Xubuntu56 » 09 Jan 2019, 00:59

Tried making PAD_ASTERIX the Fn key; didn't work. Wonder if that has something to do with "legacy"?

User avatar
Muirium
µ

Re: Help reassigning keys with Soarer

Unread post by Muirium » 09 Jan 2019, 02:26

Asterix:
Image
Though, oddly enough, a DT search says you’re right. There’s more hits for pad_asterix than pad_asterisk. Perhaps Soarer was having us on!

I’m thousands of miles from my XT. But here’s a config file I used with it at some point:

Code: Select all

# IBM XT

# hid_listen says:
# Keyboard ID: 0000
# Code Set: 1
# Mode: PC/XT

layerblock
	fn1			1
endblock

remapblock
layer 0
	f9			rctrl			#	Claim bottom function keys for left mods
	f10			lalt
	lalt		lgui
	pad_asterix	fn1				#	HHKB style Fn key
	caps_lock	rgui			#	XT sure has some strange mods
	num_lock	select_1		#	Toggle numpad navigation block
endblock

remapblock
layer 1
	left_brace	up
	semicolon	left
	quote		right
	slash		down
	l			page_up
	period		page_down
	k			home
	comma		end
	a			volume_down
	s			volume_up
	d			mute
	backspace	delete
endblock

macroblock
#	Mac app window cycling, 60% style
	macro esc lgui -ctrl -alt
		press back_quote
	endmacro

#	Shift + Shift = Caps Lock
	macro lshift rshift
		press caps_lock
	endmacro
	macro rshift lshift
		press caps_lock
	endmacro
endblock


#	Numpad nav block - toggle with Num Lock
ifselect 1
remapblock
layer 0
	pad_1		end
	pad_2		down
	pad_3		page_down
	pad_4		left
	pad_5		pad_5
	pad_6		right
	pad_7		home
	pad_8		up
	pad_9		page_up
	pad_0		ralt
	pad_period	rctrl
	pad_plus	pad_enter
endblock

Xubuntu56

Re: Help reassigning keys with Soarer

Unread post by Xubuntu56 » 09 Jan 2019, 03:26

Well, using your code, pad_asterix works perfectly! Thanks, Mu. Maybe the cartoon helped? ;) I'll have to figure out what's different in your code.
Say, does your XT really talk to hid_listen?

User avatar
Muirium
µ

Re: Help reassigning keys with Soarer

Unread post by Muirium » 09 Jan 2019, 03:34

I don’t often bother with hid_listen. The comments at the top of my config there suggest I did, way back, when I was first using the keyboard. (I had an XT autodection system in mind but don’t think I got far.) These days, I just test everything live in the gui keyboard without that abstraction.

Discussion here:
viewtopic.php?f=7&t=19922&p=426129&hili ... ac#p426129

Post Reply

Return to “Keyboards”