You are not logged in.
Continuing the discussion from https://bbs.archlinux.org/viewtopic.php?id=173418&p=17 ...
For the purposes of this discussion, let's call the keys along the top of the keyboard on the chromebook CBEscape, CB1, CB2, CB3, CB4, CB5, CB6, CB7, CB8, CB9, CB10, CBPower.
Toshiba Chromebook CB35 keycodes are
console: 59-68 = CB1-CB10
X11: 67-76 = CB1-CB10
HP Chromebook 14 keycodes are
console: 158=CB1, 159=CB2, 173=CB3 and 62-68 = CB4-CB10
X11: CB1=166, CB2=167, CB3=181 and 70-76 = F4-F10
We want the CB1-CB3 keys on the HP Chromebook to act like normal F1-F3 function keys.
Stephen304, will you try using loadkeys to set 158=F1, 159=F2, and 181=F3? I think these are different codes that you used before.
Last edited by scot14 (2014-07-18 20:15:49)
Offline
When you press one of those keys, are any messages added to the journal or to the output of dmesg?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
So actually F5-F7 is even weirder - it shows keymapnotify with no consistent keycodes in xev, but i dont care too much about those keys.
I used loadkeys with the console keycodes in both console and x11 and in both cases nothing changed. In x11, xev showed x86 back / next / refresh still.
Dmesg seems unchanged after these keys are pressed.
Offline
From a console make a file called '~/test.keys' with
alt keycode 158 = Console_1
alt keycode 159 = Console_2
alt keycode 173 = Console_3
and then run 'loadkeys ~/test.keys'.
Does this enable switching between consoles with Alt-Fx key combinations? (Just between consoles, not from X11.)
Offline
From a console make a file called '~/test.keys' with
alt keycode 158 = Console_1 alt keycode 159 = Console_2 alt keycode 173 = Console_3
and then run 'loadkeys ~/test.keys'.
Does this enable switching between consoles with Alt-Fx key combinations? (Just between consoles, not from X11.)
Awesome that worked as expected! Is there any way to make it Ctrl + Alt though? And now I just have to figure out how to make it work in X11.
Offline
Does this add the control key?
alt control keycode 158 = Console_1
alt control keycode 159 = Console_2
alt control keycode 173 = Console_3
Offline
Woah that works! I tried doing ctrl alt. I can't seem to find any good documentation on what the right modifier names are or how to specify combinations so I've just been stabbing in the dark. Any ideas for how to make it work in X11? Of course I could just switch to tty4 then switch to the desired tty as well if X11 won't cooperate.
Offline
Does this change CB1-CB3 into F1-F3 in X11?
xmodmap -e "keysym XF86Back = F1"
xmodmap -e "keysym XF86Forward = F2"
xmodmap -e "keysym XF86Reload = F3"
Offline
Does this change CB1-CB3 into F1-F3 in X11?
xmodmap -e "keysym XF86Back = F1" xmodmap -e "keysym XF86Forward = F2" xmodmap -e "keysym XF86Reload = F3"
That changes it to function keys, but it won't switch tty. I did this before and I remember my F4 had a 7th entry (XF86Switch_VT_1), which i couldn't get to add to F1-3 - in other words it seems just being mapped to F1-F3 doesn't do it.
Offline
Does this change CB1-CB3 into F1-F3 in X11?
xmodmap -e "keysym XF86Back = F1" xmodmap -e "keysym XF86Forward = F2" xmodmap -e "keysym XF86Reload = F3"
Thanks guys, this post was super helpful, I was using xbindkeys and xvkbd to set F1-10 in X11, but xmodmap is probably better. It still doesn't allow for switching from X to VCs but at least google/hp left the F4 key alone so its only a minor annoyance.
Is there some way to get the console changes made with loadkeys to be applied automatically on boot?
Offline
Thanks guys, this post was super helpful, I was using xbindkeys and xvkbd to set F1-10 in X11, but xmodmap is probably better. It still doesn't allow for switching from X to VCs but at least google/hp left the F4 key alone so its only a minor annoyance.
Is there some way to get the console changes made with loadkeys to be applied automatically on boot?
Glad this discussion was helpful! I was just looking at how to make it apply on boot, but the loadkeys wiki page references a /etc/vconsole.conf file which I don't have.
P.S. I've done a lot on the HP CB 14 archwiki page, so I'm adding this info as we figure it out.
Last edited by Stephen304 (2014-07-18 13:00:13)
Offline
Here is some code simplification:
echo "alt keycode 158 = Console_1" | loadkeys -q
echo "alt keycode 159 = Console_2" | loadkeys -q
echo "alt keycode 173 = Console_3" | loadkeys -q
Offline
What does this do?
xmodmap -e "keysym XF86Back = F1 F1 F1 F1 F1 F1 XF86Switch_VT_1"
xmodmap -e "keysym XF86Forward = F2 F2 F2 F2 F2 F2 XF86Switch_VT_2"
xmodmap -e "keysym XF86Reload = F3 F3 F3 F3 F3 F3 XF86Switch_VT_3"
Offline
I think you have to sudo those, so I don't think putting it in bashrc will work
~snip~
Actually it just makes them regular F1-F3, no terminal switching.
Last edited by Stephen304 (2014-07-18 13:28:50)
Offline
Are you talking about the console script? Try this:
echo "alt keycode 158 = Console_1" | sudo loadkeys -q
echo "alt keycode 159 = Console_2" | sudo loadkeys -q
echo "alt keycode 173 = Console_3" | sudo loadkeys -q
Offline
No need to use sudo, I just added xmodmap to my .xinitrc and used this configuration to get all the F keys working and change the search key into Mod4.
Just save this file as ~/.Xmodmap
then add this to your .xinitrc
xmodmap ~/.Xmodmap &
Also if you want to have search+arrows do pgup/dwn home/end like in chromeOS use this for ~/.xbindkeysrc and add xbindkeys to .xinitrc also:
Offline
No need to use sudo, I just added xmodmap to my .xinitrc and used this configuration to get all the F keys working ...
When you press Ctrl-Alt-F2, does the screen change to a VT?
Offline
Woah we're getting all confused here.
No need to use sudo, I just added xmodmap to my .xinitrc and used this configuration to get all the F keys working and change the search key into Mod4.
Just save this file as ~/.Xmodmap
(...)
When I said sudo I was talking about the loadkeys for console.
Are you talking about the console script? Try this:
echo "alt keycode 158 = Console_1" | sudo loadkeys -q echo "alt keycode 159 = Console_2" | sudo loadkeys -q echo "alt keycode 173 = Console_3" | sudo loadkeys -q
I was talking about xmodmap, that's the one you asked what it did for me. After snip I was talking about the second post you made. I responded in the same order to your post.
The console fix works great besides needing to run loadkeys as sudo:
alt control keycode 158 = Console_1
alt control keycode 159 = Console_2
alt control keycode 173 = Console_3
and the second console one works as well as long as it's run as root
echo "alt keycode 158 = Console_1" | sudo loadkeys -q
echo "alt keycode 159 = Console_2" | sudo loadkeys -q
echo "alt keycode 173 = Console_3" | sudo loadkeys -q
but the xmodmap only makes them regular F keys:
xmodmap -e "keysym XF86Back = F1 F1 F1 F1 F1 F1 XF86Switch_VT_1"
xmodmap -e "keysym XF86Forward = F2 F2 F2 F2 F2 F2 XF86Switch_VT_2"
xmodmap -e "keysym XF86Reload = F3 F3 F3 F3 F3 F3 XF86Switch_VT_3"
Last edited by Stephen304 (2014-07-18 14:06:51)
Offline
Now I'm with you. Also, xmodmap can be stateful, so I'm not sure about some of our tests. Looking at that now.
Regarding the console script, can you put them in /etc/rc.local and then use the systemd rc.local service? Or make some other systemd unit for them?
Offline
Also, you could make sudo run loadkeys without a password. Run visudo, and add this line to the end:
{username} ALL = (root) NOPASSWD: /usr/bin/loadkeys
where {username} is the username running the command from bashrc.
Offline
Yep, my mistake... loadkeys requires sudo.
I think the proper way to fix this (on boot) is by loading a custom keymap with /etc/vconsole.conf. I'm not sure exactly what changes need to be made though, just rebooted from my first attempt and although "localectl list-keymaps" lists my new keymap, the changes i made didn't seem to do the trick. I'll keep tinkering with it and see what i can do.
Offline
I'm wondering if both keymaps (console and X11) could be fixed with vconsole.conf because:
sapient@QonoS ~ % localectl status
System Locale: n/a
VC Keymap: chromebook-falco
X11 Layout: n/a
Leads me to think that it can. Although they may still need to be seperate keymaps.
Last edited by sapientidiot (2014-07-18 14:22:58)
Offline
I'm wondering if both keymaps (console and X11) could be fixed with vconsole.conf because:
sapient@QonoS ~ % localectl status System Locale: n/a VC Keymap: chromebook-falco X11 Layout: n/a
Leads me to think that it can. Although they may still need to be seperate keymaps.
On Toshiba Chromebook, where the function keys work as expected without changes, here is part of the output:
System Locale: LANG=en_US.UTF-8
VC Keymap: n/a
X11 Layout: us
X11 Model: pc105
Offline
Now I'm with you. Also, xmodmap can be stateful, so I'm not sure about some of our tests. Looking at that now.
Regarding the console script, can you put them in /etc/rc.local and then use the systemd rc.local service? Or make some other systemd unit for them?
Yeah I actually noticed - the snip was because I typed a bunch about the errors I was getting when I ran the xmodmap commands then I realized I forgot to reboot.
I got the console fix to run on boot - I put custom.map in root (not sure where would be a better place): /custom.map
Then created /etc/vconsole.conf
KEYMAP=/custom.map
And after reboot, I can switch tty with no problems
Keymap status before:
System Locale: LANG=en_US.UTF-8
VC Keymap: n/a
X11 Keymap: n/a
Keymap status after:
System Locale: LANG=en_US.UTF-8
VC Keymap: /custom.map
X11 Keymap: n/a
Last edited by Stephen304 (2014-07-18 14:36:54)
Offline
Offline