Firmware with non-us layout?

User avatar
Eszett

07 Apr 2014, 02:48

Hi! How do I create a firmware for Pegasus Hoof with german layout? I’ve tried it with Easy AVR keyboard firmware keymapper but I can’t see anything but english layout?

User avatar
Grendel

07 Apr 2014, 08:04

You can just use the default FW for the Hoof (uses a matrix called ANSI_ISO_JIS.) The key-codes are the same for for ANSI and ISO layouts (the extra ISO key (Non-US Backslash) is already in the matrix.) The PCB's are designed w/ all physical key configurations in mind, ie. some switches have two or even three possible locations (w/ the same traces going to them). It's up to the operating system to map codes send by the controller to actual characters.

Edit: Here's and example of what I'm trying to say. This the backside of the lower left corner of an ANSI CMS QFXT keyboard (another board made by Costar, Filco's OEM) :

Image

In ISO 105 configuration (eg. German) the LShift switch would be mounted in the other position and K45_105/ would be populated. Other ISO configurations may also have the KC-L_106 key loaded. The Japanese configuration would have the Alt & Win keys shifted and the J131_108 position loaded.

User avatar
Eszett

07 Apr 2014, 16:47

Thanks Grendel, but I must admit, I dont understand it :-(

User avatar
Halvar

07 Apr 2014, 18:16

Could you elaborate a bit on what you're trying to achieve? As you probably know, national layouts are normally not set in the keyboard firmware, but in the computer's operating system. In the keyboard firmware, everything works with keycodes.

For example, 0x2C is the key code for the seventh key on the second row, which on a US keyboard layout is the Y key, and on a German layout is the Z key. When the key is pressed, the keyboard firmware sends the signal that Key 0x2C was pressed to the computer, the operating system looks up the key in a table corresponding to the national layout that the user has set, and decides which letter corresponds to 0x2c. The "Easy AVR keyboard firmware keymapper" may call key 0x2c the "Y" key because that's what it's mapped to on what the developer of the software considers the "standard" layout (aka US layout). That still means it's mapped to Z on most German PCs.

User avatar
Eszett

07 Apr 2014, 18:25

For example, 0x2C is the key code for the seventh key on the second row, which on a US keyboard layout is the Y key, and on a German layout is the Z key.
Got it! :idea: What I’m trying to achieve is to swap some keys (keycaps as well as the corresponding keycodes/scancodes), for example “Home” with “PageUp” and “End” with “PageDown”. As far as I understand I have to use Easy AVR USB keyboard keymapper just as if it showed german layout, right? And another question: is keycode and scancode the same?

User avatar
Grendel

07 Apr 2014, 21:55

Yea, you should be fine swapping key locations, with the possible exception of the non-US \ key (the < key on a German board, betw. L-shift and Z. That key is physically not present on an ANSI board.)

Keycode and scancode are probably used synonymously in this context (I not aware of a formal definition, except maybe that "scancode" is usually used w/ the old XT/AT/PS2 interfaces.)

User avatar
Halvar

08 Apr 2014, 00:23

Eszett wrote:As far as I understand I have to use Easy AVR USB keyboard keymapper just as if it showed german layout, right?
Yes, for keys like “Home”, “PageUp”, “End” and “PageDown” there's no difference.
And another question: is keycode and scancode the same?
I use them as meaning the same. I use "keycode" as a term that's a little more general, because "scancode" suggests that the codes have some direct relationship to the keyboard's electrical matrix, which might have been the case very very long ago, but has never been the case for IBM PC compatible keyboards.

User avatar
Eszett

08 Apr 2014, 02:19

Thanks. That means I can swap keycodes / scancodes only, without having influence on the actual characters? For example, if I’d like to have the Dollar sign “$” on [Shift]+[D], I can’t program the firmware to do that?

User avatar
Halvar

08 Apr 2014, 08:36

We discussed this earlier in another thread, didn't we?

Findecanor

08 Apr 2014, 11:33

Eszett wrote:Thanks. That means I can swap keycodes / scancodes only, without having influence on the actual characters? For example, if I’d like to have the Dollar sign “$” on [Shift]+[D], I can’t program the firmware to do that?
That's right. You would have to change the keymap on your host computer to make Shift-D produce the dollar sign.

User avatar
Eszett

08 Apr 2014, 15:40

Findecanor wrote:That's right. You would have to change the keymap on your host computer to make Shift-D produce the dollar sign.
Thanks. So what’s the typical purpose of programming a FW? Just swapping keycodes?

User avatar
Muirium
µ

08 Apr 2014, 16:24

Nope. Way beyond that. Programmable controllers are for adding layers and macros. Layers are how you pack entire alternate layouts into the same physical space, and are what enable 60% keyboards to contain full functionality in a fraction of the space. Macros are saved key sequences including mods, and are just as powerful.

Findecanor

08 Apr 2014, 16:44

Unfortunately, bpiphany's firmware for the replacement controllers does not support layers or macros, media keys or any other fancy features - only remapping.
Those features are in Hasu's tmk_keyboard though, but the official source tree for that does not support bpiphany's controllers other than the old "HID Liberation Device".
But maybe there is a fork of tmk_keyboard somewhere...

User avatar
Muirium
µ

08 Apr 2014, 16:55

Oh right. All my custom controllers are either Soarer's or Hasu's. Didn't realise.

User avatar
Eszett

08 Apr 2014, 19:06

Alright, and can you give me an example what people usually do with Pegasus Hoof? I mean what concrete remappings for example?

bpiphany

08 Apr 2014, 19:38

Findecanor wrote:Unfortunately, bpiphany's firmware for the replacement controllers does not support layers or macros, media keys or any other fancy features - only remapping.
Those features are in Hasu's tmk_keyboard though, but the official source tree for that does not support bpiphany's controllers other than the old "HID Liberation Device".
But maybe there is a fork of tmk_keyboard somewhere...
Easy AVR firmware supports them, and without having had a look at it myself I can't think it's any more complicated than understanding my code. You really wouldn't want me to write any andvanced firmwares. I'm really bad at coding in c.. =P

Findecanor

08 Apr 2014, 20:12

Bah. I'm sorry, I don't know what I am writing about.. I just know from what I have read of the source code in bpiphany's code and in tmk.

Post Reply

Return to “Workshop”