Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working on keymap for Chromebook (coreboot with linux) #572

Closed
Merith-TK opened this issue Sep 4, 2023 · 10 comments · May be fixed by #573
Closed

Working on keymap for Chromebook (coreboot with linux) #572

Merith-TK opened this issue Sep 4, 2023 · 10 comments · May be fixed by #573

Comments

@Merith-TK
Copy link

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
Copy link
Author

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
Copy link
Author

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

@nsbgn
Copy link

nsbgn commented Sep 4, 2023

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.

@Merith-TK
Copy link
Author

Merith-TK commented Sep 5, 2023

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

@nsbgn
Copy link

nsbgn commented Sep 5, 2023

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

@Merith-TK
Copy link
Author

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
Copy link
Author

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

@archisman-panigrahi
Copy link

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)

@Merith-TK
Copy link
Author

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

@archisman-panigrahi
Copy link

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.

@rvaiya rvaiya closed this as completed Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants