keyd icon indicating copy to clipboard operation
keyd copied to clipboard

Working on keymap for Chromebook (coreboot with linux)

Open Merith-TK opened this issue 2 years ago • 10 comments

I am working on an key-remap for the chromebook (coreboot bios + actual linux) and am running into an issue, im trying to set it up so it follows akin to the same format as the chromebook, where the function keys work as they do on chromeos, but ctrl+alt (or meta+fnX) overrides back to normal fn

keyd virtual keyboard   0fac:0ade       back down
keyd virtual keyboard   0fac:0ade       back up
keyd virtual keyboard   0fac:0ade       forward down
keyd virtual keyboard   0fac:0ade       forward up
keyd virtual keyboard   0fac:0ade       refresh down
keyd virtual keyboard   0fac:0ade       refresh up
keyd virtual keyboard   0fac:0ade       f4 down
keyd virtual keyboard   0fac:0ade       f4 up
keyd virtual keyboard   0fac:0ade       f5 down
keyd virtual keyboard   0fac:0ade       f5 up
keyd virtual keyboard   0fac:0ade       f6 down
keyd virtual keyboard   0fac:0ade       f6 up
keyd virtual keyboard   0fac:0ade       f7 down
keyd virtual keyboard   0fac:0ade       f7 up
keyd virtual keyboard   0fac:0ade       mute down
keyd virtual keyboard   0fac:0ade       mute up
keyd virtual keyboard   0fac:0ade       volumedown down
keyd virtual keyboard   0fac:0ade       volumedown up
keyd virtual keyboard   0fac:0ade       volumeup down
keyd virtual keyboard   0fac:0ade       volumeup up
keyd virtual keyboard   0fac:0ade       f13 down
keyd virtual keyboard   0fac:0ade       f13 up

with my work done to it

f1 = back
f2 = forward
f3 = refresh
f4 = f5

## Volume Keys
f8 = mute
f9 = volumedown
f10 = volumeup 

Attached is a image of what the keys are supposed to be image Back Forward refresh Effectively F11 Switch Windows (akin to alt tab) Brightness+ Brightness- Mute VolDown VolUp

how would I make it so that when I press ctrl+alt it defaults back to standard function keys?

Merith-TK avatar Sep 04 '23 15:09 Merith-TK

What I mean by "coreboot", is with an good selection of common chromebooks, it is possible to replace the BIOS with an standard UEFI/CSM based Bios (known as "coreboot") so that normal operating systems can be easily installed (in my case I installed arch linux)

Merith-TK avatar Sep 04 '23 15:09 Merith-TK

also is it possible to make these configs not affect TTY's?

Merith-TK avatar Sep 04 '23 15:09 Merith-TK

how would I make it so that when I press ctrl+alt it defaults back to standard function keys?

[main]
f1 = back
f2 = forward
f3 = refresh
# etcetera

[control+alt]
f1 = f1
f2 = f2
f3 = f3
# etcetera

also is it possible to make these configs not affect TTY's?

keyd knows nothing about the graphical environment it runs (or doesn't run) in, so no, I don't think so. You could potentially use keyd-application-mapper, though.

nsbgn avatar Sep 04 '23 19:09 nsbgn

THat way of mapping presses didnt really work right for what I needed, now I just have one key that is not mapped properly, and thats the [_]]] key,

[ids]
*
[main]
## Disabled until escape method can be made for TTY
f1 = back
f2 = forward
f3 = refresh
f4 = print
f5 = 
f6 = brightnessdown
f7 = brightnessup
f8 = mute
f9 = volumedown
f10 = volumeup

# cant consistently get to work
[leftmeta]
f1 = f1
f2 = f2
f3 = f3
f4 = f4
f5 = f5
f6 = f6
f7 = f7
f8 = f8
f9 = f9
f10 = f10

[control+alt]
f1 = C-A-f1
f2 = C-A-f2
f3 = C-A-f3
f4 = C-A-f4
f5 = C-A-f5
f6 = C-A-f6
f7 = C-A-f7
f8 = C-A-f8
f9 = C-A-f9
f10 = C-A-f10

Merith-TK avatar Sep 05 '23 15:09 Merith-TK

THat way of mapping presses didnt really work right for what I needed

What didn't work?

the [_]]] key,

~What do you mean? Is that the leftmeta key?~ I just got it, that's the switch windows key, right? I'd assume that A-tab would be the suitable replacement in most desktop environments?

# cant consistently get to work
[leftmeta]
f1 = f1
f2 = f2

That's because leftmeta, by default, refers only to a key, not a layer that is activated by anything. You should either override the meta layer instead, or create the leftmeta layer and assign it to leftmeta, like so:

[main]
leftmeta = layer(leftmeta)

[leftmeta:M]
f1 = f1
f2 = f2

nsbgn avatar Sep 05 '23 20:09 nsbgn

while that fixes things, now when I use my tilingwm's hotkeys, it no work (meta+d is supposed to open a runbox, now it only presses D on the keyboard

replacing leftmeta with meta in the config I had before however, does work just fine

Merith-TK avatar Sep 06 '23 03:09 Merith-TK

I figured it out, you were correct with the leftmeta being the wrong grouping, and now it works as intended, going with your suggestion for just A-tab for now for F3,

[ids]
*

## Chromebook function keys
[main]
f1 = back
f2 = forward
f3 = refresh
f4 = print
f5 = A-tab
f6 = brightnessdown
f7 = brightnessup
f8 = mute
f9 = volumedown
f10 = volumeup

## Allow F1-10 access through meta+fnX
[meta]
f1 = f1
f2 = f2
f3 = f3
f4 = f4
f5 = f5
f6 = f6
f7 = f7
f8 = f8
f9 = f9
f10 = f10

## Allow TTY access
[control+alt]
f1 = C-A-f1
f2 = C-A-f2
f3 = C-A-f3
f4 = C-A-f4
f5 = C-A-f5
f6 = C-A-f6
f7 = C-A-f7
f8 = C-A-f8
f9 = C-A-f9
f10 = C-A-f10

Merith-TK avatar Sep 06 '23 03:09 Merith-TK

Check out https://github.com/WeirdTreeThing/cros-keyboard-map. It generates a specific layout for the specific chromebook (not all chromebooks have the same layout)

archisman-panigrahi avatar Oct 18 '23 18:10 archisman-panigrahi

I based mine off the fact that if you were to plug any regular old keyboard into a chromebook, F1-10 all serve damn near the same functions,

Also why does the one you linked reference vivaldi specifically? thats an special web browser

Merith-TK avatar Oct 19 '23 12:10 Merith-TK

Vivaldi is also the name of the keyboard firmware for chromebooks https://www.phoronix.com/news/Linux-5.10-Chromebook-Vivaldi.

It is not related to the web browser.

archisman-panigrahi avatar Oct 19 '23 17:10 archisman-panigrahi