Teensy Coding (M122 key mapping)

User avatar
Go-Kart

10 Mar 2021, 15:47

So I have a brilliant M122 (thanks Muirium!), have built a terminal to USB with a Teensy 2.0 and been using the keyboard with the ATmega32U4 firmware. All good.

My next mission was to map useful functions outside of the standard alphas/mods to the additional F keys, etc. and to remap some keys with odd placements (e.g. Num Lock outputs Escape). I've got HID Listen, can see the scan codes. I have the Soarer code table, I have the config files and the scaswr tool. I'm just a little stuck on what exactly to do next. After perusing the legacy.sc config, I spotted that that may remap some of the functionality I wanted so I tried to load it onto scaswr but nothing seems to happen.

My thinking was I could then simply copy and modify the legacy config file to my needs and then I'd be set. I've tried searching the forums and Wiki, along with YouTube too; I've been over the Soarer's site and I can't figure out where I'm going wrong. This is my first try at such a thing and although I have decent instincts, I'm on the edge of my understanding as it is. If someone could please point me to a thread or give me a hint where I'm going wrong, that would be greatly appreciated!

Thanks,
Adam

User avatar
Muirium
µ

10 Mar 2021, 16:35

Soarer's converter can handle this, no bother! What you need in your config file is a remapblock something like this:

Code: Select all

remapblock
layer 0
	insert		fn1
	caps_lock	lctrl
	lctrl		lalt
	lalt		lgui
	ralt		rgui
	rctrl		ralt
	num_lock	select_1	#	Toggle numpad to navigation block
	printscreen	mute		#	Media keys where I expect them
	scroll_lock	volume_down
	pause		volume_up
endblock
These are straight out of my own config file. Change them to whatever you like.

Layer 0 is the default layer: that means these are automatically active. So all you have to do is use hid_listen to find the keycode of each key you want to remap, and then assign it something useful from the list. Then build with scas and write to your keyboard with scwr.

I included the keycode file list in my 64-bit tools thread. Just click the spoiler button by codes to see the whole list.

User avatar
depletedvespene

10 Mar 2021, 16:55

Go-Kart wrote:
10 Mar 2021, 15:47
So I have a brilliant M122 (thanks Muirium!), have built a terminal to USB with a Teensy 2.0 and been using the keyboard with the ATmega32U4 firmware. All good.

My next mission was to map useful functions outside of the standard alphas/mods to the additional F keys, etc. and to remap some keys with odd placements (e.g. Num Lock outputs Escape). I've got HID Listen, can see the scan codes. I have the Soarer code table, I have the config files and the scaswr tool. I'm just a little stuck on what exactly to do next. After perusing the legacy.sc config, I spotted that that may remap some of the functionality I wanted so I tried to load it onto scaswr but nothing seems to happen.

My thinking was I could then simply copy and modify the legacy config file to my needs and then I'd be set. I've tried searching the forums and Wiki, along with YouTube too; I've been over the Soarer's site and I can't figure out where I'm going wrong. This is my first try at such a thing and although I have decent instincts, I'm on the edge of my understanding as it is. If someone could please point me to a thread or give me a hint where I'm going wrong, that would be greatly appreciated!

Thanks,
Adam
If you want, unzip my collection of SC files into a directory, open F122_and_M122.sc with a text editor and start perusing. All files are thoroughly documented, so you shouldn't have any problems understanding how to make changes to better serve your own needs and whims.

SC.zip
.SC files for Model F/M keyboards.
(13.31 KiB) Downloaded 20 times

User avatar
Go-Kart

10 Mar 2021, 17:47

Thanks very much, guys! This isn't quite my problem though. I can just about handle the editing of the .sc files (although I may not have to now, thank you very much :D ). It's the how to put the .sc file onto the Teensy. When I hit scas.exe, nothing happens (I've checked and Bitdefender ain't blocking it). When I hit scaswr.bat it opens command line, says, "Assembling" , etc. but I can't insert or do anything. It just says "Press any key to continue..." I press a key and it closes.

It's getting the the .sc file onto the Teensy that's stumping me.

User avatar
Muirium
µ

10 Mar 2021, 17:51

Run scas and scwr separately. scaswr is just a batch file that runs them sequentially, and may be hiding errors from your view.

Oh, and try running scinfo to check the converter is running correctly on your Teensy. That always helps! :lol:

User avatar
Go-Kart

10 Mar 2021, 18:02

Oh I've tried :lol: When I hit any of the executable files in the Soarer tools folder, either nothing happens or cmd briefly flashes up for a split second then disappears! I've tried opening as administrator too. scaswr is the only one that opens and stays open.

This makes me think that it may be a computer issue... Bloody Windows. I'll jump on my laptop and investigate.

User avatar
depletedvespene

10 Mar 2021, 18:21

Go-Kart wrote:
10 Mar 2021, 18:02
Oh I've tried :lol: When I hit any of the executable files in the Soarer tools folder, either nothing happens or cmd briefly flashes up for a split second then disappears! I've tried opening as administrator too. scaswr is the only one that opens and stays open.

This makes me think that it may be a computer issue... Bloody Windows. I'll jump on my laptop and investigate.
Start up a command line window (cmd.exe) and work from there, not from Windows Explorer. Pass the .sc file as an argument to the .bat file.

micmil

10 Mar 2021, 19:15

I really do wonder what was up when the M122 configuration was decided on. The entire numpad is a trainwreck. I can imagine how it went after months of developing the hardware and other layouts Soarer gets to that thing and just goes "Nah, if they want this behemoth they can deal with it themselves." :lol:

User avatar
Go-Kart

10 Mar 2021, 19:28

lol. O.K. gents, I was close to a headache but I've got it all working! I now also know how to pass sc files as arguments to bat files!

I'm gonna put every F to work :lol:

Thanks the help!

User avatar
Muirium
µ

10 Mar 2021, 19:34

Well done! You’re learning the zen of Soarer now. May the forced scan codes be with you.
depletedvespene wrote:
10 Mar 2021, 18:21
Go-Kart wrote:
10 Mar 2021, 18:02
Oh I've tried :lol: When I hit any of the executable files in the Soarer tools folder, either nothing happens or cmd briefly flashes up for a split second then disappears! I've tried opening as administrator too. scaswr is the only one that opens and stays open.

This makes me think that it may be a computer issue... Bloody Windows. I'll jump on my laptop and investigate.
Start up a command line window (cmd.exe) and work from there, not from Windows Explorer. Pass the .sc file as an argument to the .bat file.
Correct. Open your terminal and type the commands. The GUI is not helping you here!

I think we actually need a complete n00bs guide for Soarer, given how “passing arguments” on the command line is not everyone’s native language any more. Folk just double click like Windows taught them.
micmil wrote:
10 Mar 2021, 19:15
I really do wonder what was up when the M122 configuration was decided on. The entire numpad is a trainwreck. I can imagine how it went after months of developing the hardware and other layouts Soarer gets to that thing and just goes "Nah, if they want this behemoth they can deal with it themselves." :lol:
Actually, look at Soarer’s key code list and you’ll see it’s all there. The 122s are just doing their thing. Wacky as it is. The F122s did it all before them, remember.

micmil

10 Mar 2021, 21:27

Muirium wrote:
10 Mar 2021, 19:34
Actually, look at Soarer’s key code list and you’ll see it’s all there. The 122s are just doing their thing. Wacky as it is. The F122s did it all before them, remember.
I know, I'm just riffing on the oddball mapping compared to what we would mentally expect today. I can't tell you how many times I've hit F13 looking for ESC, for example, and that numpad mapping is just plain wacky.
I think we actually need a complete n00bs guide for Soarer, given how “passing arguments” on the command line is not everyone’s native language any more. Folk just double click like Windows taught them.
The command line was deprecated in major use sometime around '73 when PARC developed the Alto. It's just taken some people a while to catch up. Like "sysadmins" and "developers," whoever they are. :D One of my too-many projects is to put together a guide for noobasoarers as soon as I feel I'm beyond that stage myself. I'm surprised by how ultimately simple it is but I do feel the process is described a bit clunky in the existing docs.

User avatar
Muirium
µ

10 Mar 2021, 21:57

You’re quite right. What we really want is a GUI for Soarer’s converter. The way he designed it—no need to reflash just to remap—is actually very nicely aligned with a live running config interface.

Xwhatsit managed that, with his cap sense controller hardware too. But his Qt app doesn’t run on current Macs any more and I’ve no idea how to rebuild it.

User avatar
depletedvespene

10 Mar 2021, 22:52

micmil wrote:
10 Mar 2021, 21:27
The command line was deprecated in major use sometime around '73 when PARC developed the Alto.
Words of true ignorance right there. 👍👍👍

Don't confuse "text-only screen" with "command line interface".

User avatar
Go-Kart

10 Mar 2021, 23:16

I feel I have the very minimum amount of computer knowledge enough to muddle my way through something like what I was doing today. God help any newly minted vintage keyboard enthusiast who know even less than I do! Though I suppose that's where pre-made Soarer's converters come in, right?

User avatar
depletedvespene

10 Mar 2021, 23:24

Go-Kart wrote:
10 Mar 2021, 23:16
I feel I have the very minimum amount of computer knowledge enough to muddle my way through something like what I was doing today. God help any newly minted vintage keyboard enthusiast who know even less than I do! Though I suppose that's where pre-made Soarer's converters come in, right?
I know a lot and I still prefer pre-made Soarer's converters, as knowledge ain't no match against thick, clumsy fingers (like mine are). :mrgreen:

User avatar
Muirium
µ

10 Mar 2021, 23:53

To actually program one of those pre-made Soarer's, your clumsy fingers are still going to have to work the command line…

People aren't "ignorant" of the old ways of computers, so much as we nerds can be ignorant of why the hell they should know all these things which died before they were born! :lol:

User avatar
depletedvespene

11 Mar 2021, 00:24

Muirium wrote:
10 Mar 2021, 23:53
To actually program one of those pre-made Soarer's, your clumsy fingers are still going to have to work the command line…
Well, of course... that's why I like keyboards with a strong tactile response, like Model F and M keyboards.

Muirium wrote:
10 Mar 2021, 23:53
People aren't "ignorant" of the old ways of computers, so much as we nerds can be ignorant of why the hell they should know all these things which died before they were born! :lol:
Sure, but that kind of thinking applies to things like a slide rule, not to the command line...


ShiRting aside, the Soarer's Converter's documentation is lacking in several areas, which we could work on.

micmil

11 Mar 2021, 01:22

depletedvespene wrote:
10 Mar 2021, 22:52
Words of true ignorance right there. 👍👍👍

Don't confuse "text-only screen" with "command line interface".
Because, of course, anyone with a different opinion from yours is "ignorant." It's not decades of experience coming to a different conclusion, ever.
Sure, but that kind of thinking applies to things like a slide rule, not to the command line...
It applies equally. Someone out there uses a slide rule on the daily. It may be to clean out their ears, but they're using it.
ShiRting aside, the Soarer's Converter's documentation is lacking in several areas, which we could work on.
Definitely. I see some of the stuff other people put together and wonder where in the documentation that is and it turns out it came from a forum post they read back in aught-five. :lol: It's far from the worst, that's for certain, but it can be made much more straightforward and less "man pagey" for lack of a better term.

Also, it's a good idea to remember I exaggerate my opinion just enough to get up the maximum amount of noses. :D

User avatar
depletedvespene

11 Mar 2021, 02:41

micmil wrote:
11 Mar 2021, 01:22
depletedvespene wrote:
10 Mar 2021, 22:52
Words of true ignorance right there. 👍👍👍

Don't confuse "text-only screen" with "command line interface".
Because, of course, anyone with a different opinion from yours is "ignorant." It's not decades of experience coming to a different conclusion, ever.
Well, YOU are the one claiming the command line interface has been "deprecated" "since 1973" because of the development of the first GUI, so...

micmil wrote:
11 Mar 2021, 01:22
Also, it's a good idea to remember I exaggerate my opinion just enough to get up the maximum amount of noses. :D
Then don't defend yourself by claiming as "differing opinions" facts that don't suit you. 👍


micmil wrote:
11 Mar 2021, 01:22
ShiRting aside, the Soarer's Converter's documentation is lacking in several areas, which we could work on.
Definitely. I see some of the stuff other people put together and wonder where in the documentation that is and it turns out it came from a forum post they read back in aught-five. :lol: It's far from the worst, that's for certain, but it can be made much more straightforward and less "man pagey" for lack of a better term.
Weeeeeeeeeell... some of the documentation I've seen would be improved if it were man pagey.

Let's focus on that instead of one-up-trolling.

micmil

11 Mar 2021, 04:31

"Don't one-up-troll after my one-up-troll!"
:roll:

Anyway, back to the actual off-topic, so we at least agree the documentation is weak and that a GUI tool would be ideal. Hooray. I can help on the documentation (who would have guessed I have a knack for dumbing things down?) once I feel I'm up to speed with how the thing actually operates.

It's weird to me how Soarer's convertor is one of the most common tools in the hobby but the wiki page is essentially empty. Is there any reason it couldn't be used as a repository for all of this info? I have no idea what is and is not considered appropriate content.

User avatar
Muirium
µ

11 Mar 2021, 17:27

Soarer’s docs (included in his original zip file) should really all be on the wiki, then separate pages written to illustrate the good stuff everyone wants to know.

I say “should” instead of jumping in to do it myself because I’ve a bad habit of writing looooooong essays with stories all their own instead of short, sweet, straightforward docs. Not a strength of mine!

micmil

11 Mar 2021, 19:17

That's a good call. It would be pretty easy to do that. I could get the info basically moved over verbatim over the weekend then work through breaking it down into different pages for the different aspects.

micmil

14 Mar 2021, 20:23

I'm getting jack done this weekend. It's gone quagmire around here. I'm gonna go brick wall my forehead for a while. :lol:

User avatar
Go-Kart

14 Mar 2021, 20:50

You're doing God's work!

Post Reply

Return to “Workshop”