Hi Adam,
I have solved the keyboard remap problem. I will post my solution here.
I used to use the xmodmap, but it doesn't work in Wayland anymore. So I dig into the xkb, I found two webpages particularly helpful.
https://wiki.archlinux.org/index.php/X_KeyBoard_extension
http://www.charvolant.org/~doug/xkb/html/index.html

After reading these webpages, I have solved my problem. But my solution has its limits, I think it can only handle keyboard remap, but if you want to add some more advanced stuff on it, I don't think it will work.

To remap the keys, go to the directory:
/usr/share/X11/xkb/keycodes/

The files are mappings from key code that sent from keyboard hardware and the key names that actually prcoessed by the X system. For example,
<LALT>=64
This means that when X system received the keycode 64 from the keyboard, I will map it to the left alt key in the X system, and sent <LALT> to other programs in X to get the functions about that key. So the solution is pretty simple, suppose that you want to swap Left Ctrl and Left Alt, the original configuration file is like this:
<LALT>=64
<LCTL>=37
What you need to do is just change it into:
<LALT>=37
<LCTL>=64
then restart the laptop.


Another thing is that there are several(maybe 10)  keycode configuration files in that directory, you don't need to change them all. I think they are for various platforms. I just change the file names evdev.

Another thing is I know that there will updates for Rawhide nearly everyday, how can I get the release history or future schedule of Rawhide? Thanks.

Bowen Wang

On Sat, Sep 24, 2016 at 4:09 PM, Adam Williamson <adamwill@fedoraproject.org> wrote:
On Sat, 2016-09-24 at 15:06 -0500, Bowen Wang wrote:
> Hi everyone,
> I just got my rawhide installed last night. This is pretty good. But there
> are some issues that I cannot solve myself:
> 1. I cannot remap my keyboard layout using xmodmap. My xmodmap script is as
> below:
> xmodmap -e "remove Lock = Caps_Lock"
> xmodmap -e "keycode 66 = BackSpace BackSpace BackSpace BackSpace"
> xmodmap -e "keycode 22 = Tab ISO_Left_Tab Tab ISO_Left_Tab"
> xmodmap -e "keycode 23 = Escape NoSymbol Escape"
> xmodmap -e "keycode 9 = Caps_Lock"
> xmodmap -e "clear control"
> xmodmap -e "clear mod1"
> xmodmap -e "remove mod4 = Super_L Super_R"
> xmodmap -e "keycode 133 = Alt_L Meta_L Alt_L Meta_L"
> xmodmap -e "keycode 134 = Alt_R Meta_R Alt_R Meta_R"
> xmodmap -e "keycode 37 = Super_L NoSymbol Super_L"
> xmodmap -e "keycode 64 = Control_L NoSymbol Control_L"
> xmodmap -e "keycode 105 = Super_R NoSymbol Super_R"
> xmodmap -e "keycode 108 = Control_R NoSymbol Control_R"
> xmodmap -e "add Control = Control_L Control_R"
> xmodmap -e "add mod1 = Alt_L Meta_L Alt_R Meta_R"
> xmodmap -e "add mod4 = Super_L Super_R"
> xmodmap -e "add Lock = Caps_Lock"
>
>
> I can use this script on all other linux machines. When I put this in
> fedora rawhide, it didn't work. Some of the keymap can work outside the
> terminal, for example, some of the remap can work in Firefox, buy not in
> terminal.
> I have tried to put this script file in several place:
> ~/.bashrc
> ~/.bashrc_profile
> a file named rc.local in /etc or /usr, sorry I cannot remember
> ~/.xsession
> ~/.xmodmap
> ~/.Xmodmap
>
>
> They all didn't work.
> I use the Programmer Dvorak Keyboard Layout.
> Can anyone help me this out? Thanks.

Hi Bowen! Just wanted to make sure you're aware Rawhide is the most
'unstable' development version of Fedora; it's more stable and tested
than it used to be but we still don't recommend it for everyday use.
It's awesome to have people running it (we want more!) but we do
recommend you have a stable Fedora release around too just in case
Rawhide goes wrong.

As for your problem - if you're running Workstation, then it's probably
not working because you're not using X :) Workstation in Fedora 25 and
Rawhide now defaults to using Wayland. So if that's your situation,
you'll need to look up how to do the equivalent of xmodmap on Wayland -
I don't know about this off-hand. I looked it up just quickly with
Google, and here are some references that may help:

https://askubuntu.com/questions/501659/how-to-swap-command-and-control-keys-with-xkb-step-by-step
https://unix.stackexchange.com/questions/294286/how-can-i-autoload-xkb-customisations-in-gnome
http://ebb.org/bkuhn/blog/2011/05/31/x.html (note: from 2011, so things may have improved)

Basically xmodmap indeed doesn't work on Wayland, you need to customize
the xkb configuration instead. xkb is...er...fun to learn about...hope
those links help. :) Good luck! Maybe if you're successful you could
write up a handy blog post or something explaining your findings?

Thanks a lot!
--
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net
_______________________________________________
test mailing list -- test@lists.fedoraproject.org
To unsubscribe send an email to test-leave@lists.fedoraproject.org