Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (Not For Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (Not For Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 17th April 2017, 01:46 AM
tsukiyoarts Offline
Registered User
 
Join Date: Apr 2017
Location: Brazil
Posts: 8
linuxfedorafirefox
Thumbs up Keyboard, Xkb: Mapping cmd keys to ctrl, win to ctrl, restore esc and delete +

I will not use fedora for long, but I want to share something. Previously I used xmodmap to modify my keyboard key layout, but well, it does not work anymore on fedora 25 and some newer linux distributions, but xkb evdev direct edit does

My current keyboard is bluetooth again and uses cmd key (feature of mini keyboards I think). Usually the win key gets mapped to the two cmd keys, esc does not work and the delete key has other function attached to it.



Code:
su
gedit /usr/share/X11/xkb/keycodes/evdev
There are 2 ways of discovering the code of the wrong key, one is using the command xev on terminal, the other is by logical thinking, if the delete key is actually powering the system down, search in evdev the key name which has power on it and switch its keycode with the one which has delete in the key name. Worked for me. I needed xev for the esc key.

My layout is as follows, it seems each kernel update it gets reseted, so keep a copy in your user folder when that happens. I changed the esc key code to 180, switched the key codes of win keys and ctrl keys and the delete key with the power key.

Code:
<LCTL> = 133;
<RCTL> = 134;
<LWIN> = 37;
<RWIN> = 105;
<ESC> = 180;
<DELE> = 124;
<POWR> = 119;
You can also change the backspace key second string (named too backspace) in the file at /usr/share/X11/xkb/symbols/pc to delete, and cause it to act as a delete key when shift key is pressed with the backspace key. Like an apple keyboard (which I like by size and style).

Note 1: Do mess around with the xkb pc file, as it resulted in strange bluetooth issues for me. I think bluetooth failed because the keyboard layout code failed due to modifications.

Note 2: I think there must be no duplicate key codes in different key names at evdev.

Note 3: I tried to post the full code but the forum system refused. How am I to make a proper guide that way?

Last edited by tsukiyoarts; 17th April 2017 at 11:13 PM.
Reply With Quote
  #2  
Old 17th April 2017, 11:41 PM
lsatenstein Online
Registered User
 
Join Date: Jun 2005
Location: Montreal, Que, Canada
Posts: 4,099
linuxfedorafirefox
Re: Keyboard, Xkb: Mapping cmd keys to ctrl, win to ctrl, restore esc and delete +

In a similar way I add to ca, and us layouts, the EuroSign and the yen. (By the way, I use the two characters into passwords, because the two are not on the standard keyboard layouts)

These are the two replacement lines.
before
key <AD03> { [ e, E ] };
after
key <AD03> { [ e, E,EuroSign ] };

before
key <AD06> { [ y, Y ] };
after
key <AD06> { [ y, Y,yen ] };
__________________
Leslie in Montreal

Interesting web sites list
http://forums.fedoraforum.org/showth...40#post1697840
Reply With Quote
  #3  
Old 18th April 2017, 12:34 AM
tsukiyoarts Offline
Registered User
 
Join Date: Apr 2017
Location: Brazil
Posts: 8
linuxfedorafirefox
Re: Keyboard, Xkb: Mapping cmd keys to ctrl, win to ctrl, restore esc and delete +

Quote:
Originally Posted by lsatenstein View Post
In a similar way I add to ca, and us layouts, the EuroSign and the yen. (By the way, I use the two characters into passwords, because the two are not on the standard keyboard layouts)

These are the two replacement lines.
before
key <AD03> { [ e, E ] };
after
key <AD03> { [ e, E,EuroSign ] };

before
key <AD06> { [ y, Y ] };
after
key <AD06> { [ y, Y,yen ] };
Good night. That is some pretty clever thinking mister.

In my opinion the downside of using special characters for password is which sometimes you may want to access something from another operational system, where or the character does not exist or is harder to input, and sometimes there is no time or will to also learn how to customize the keyboard on those systems.

At command line interface mode (for emergencies), I think sometimes the keyboard custom layout may not be recognized and you will not be able to easily change that to input the correct root password for example. If one only use such special passwords on their linux computer login and root, and not at sites accessed from other operational systems, then the risk of trouble decreases I think.

In my case using ¥ would not work for security as it is what they use in Japan, the € would work though.

Last edited by tsukiyoarts; 18th April 2017 at 06:18 AM.
Reply With Quote
  #4  
Old 21st April 2017, 05:14 PM
mtk Offline
Registered User
 
Join Date: Apr 2004
Posts: 194
windows_98_nt_2000chrome
Re: Keyboard, Xkb: Mapping cmd keys to ctrl, win to ctrl, restore esc and delete +

i'm using xmodmap on F25 without a problem. to what are you referring when you say it 'does not work'?
Reply With Quote
  #5  
Old 22nd April 2017, 02:55 AM
lsatenstein Online
Registered User
 
Join Date: Jun 2005
Location: Montreal, Que, Canada
Posts: 4,099
linuxfedorafirefox
Re: Keyboard, Xkb: Mapping cmd keys to ctrl, win to ctrl, restore esc and delete +

Quote:
Originally Posted by mtk View Post
i'm using xmodmap on F25 without a problem. to what are you referring when you say it 'does not work'?
When you have two or three layouts for your keyboard. For example, I use English, French, and I am wanting to program in APL. xmodmap is based on a specific keyboard layout. for example,
xmodmap over a US layout and then change to de or fr, and the xmodmap effect is all screwed up.

I am exploring setxkbmap to learn more about it.

APL
Code:
                                                                              ⊃ ∨ ∧ ⌊ ○ ⊂
╔═════╦═════╦═════╦═════╦═════╦═════╦═════╦═════╦═════╦═════╦═════╦═════╦═════╦══════════╗
║ ~   ║ ! ⌶ ║ @ ⍫ ║ # ⍒ ║ $ ⍋ ║ % ⌽ ║ ^ ⍉ ║ & ⊖ ║ * ⍟ ║ ( ⍱ ║ ) ⍲ ║ _ ! ║ + ⌹ ║          ║
║ ` ◊ ║ 1 ¨ ║ 2 ¯ ║ 3 < ║ 4 ≤ ║ 5 = ║ 6 ≥ ║ 7 > ║ 8 ≠ ║ 9 ∨ ║ 0 ∧ ║ - × ║ = ÷ ║  BACKSP  ║
╠═════╩══╦══╩══╦══╩══╦══╩══╦══╩══╦══╩══╦══╩══╦══╩══╦══╩══╦══╩══╦══╩══╦══╩══╦══╩══╦═══════╣
║        ║ Q   ║ W ⍹ ║ E ⋸ ║ R   ║ T ⍨ ║ Y ¥ ║ U   ║ I ⍸ ║ O ⍥ ║ P ⍣ ║ { ⍞ ║ } ⍬ ║  | ⊣  ║
║  TAB   ║ q ? ║ w ⍵ ║ e ∈ ║ r ⍴ ║ t ∼ ║ y ↑ ║ u ↓ ║ i ⍳ ║ o ○ ║ p ⋆ ║ [ ← ║ ] → ║  \ ⊢  ║
╠════════╩═╦═══╩═╦═══╩═╦═══╩═╦═══╩═╦═══╩═╦═══╩═╦═══╩═╦═══╩═╦═══╩═╦═══╩═╦═══╩═╦═══╩═══════╣
║ (CAPS    ║ A ⍶ ║ S   ║ D   ║ F   ║ G   ║ H ⍋ ║ J ⍤ ║ K   ║ L ⌷ ║ : ≡ ║ " ≢ ║           ║
║  LOCK)   ║ a ⍺ ║ s ⌈ ║ d ⌊ ║ f _ ║ g ∇ ║ h ∆ ║ j ∘ ║ k ' ║ l ⎕ ║ ; ⍎ ║ ' ⍕ ║  RETURN   ║
╠══════════╩═══╦═╩═══╦═╩═══╦═╩═══╦═╩═══╦═╩═══╦═╩═══╦═╩═══╦═╩═══╦═╩═══╦═╩═══╦═╩═══════════╣
║              ║ Z   ║ X χ ║ C ¢ ║ V   ║ B £ ║ N   ║ M   ║ < ⍪ ║ > ⍙ ║ ? ⍠ ║             ║
║  SHIFT       ║ z ⊂ ║ x ⊃ ║ c ∩ ║ v ∪ ║ b ⊥ ║ n ⊤ ║ m | ║ , ⍝ ║ . ⍀ ║ / ⌿ ║    SHIFT    ║
╚══════════════╩═════╩═════╩═════╩═════╩═════╩═════╩═════╩═════╩═════╩═════╩═════════════╝
__________________
Leslie in Montreal

Interesting web sites list
http://forums.fedoraforum.org/showth...40#post1697840
Reply With Quote
  #6  
Old 22nd April 2017, 04:40 AM
gordon64
Guest
 
Posts: n/a
linuxchrome
Re: Keyboard, Xkb: Mapping cmd keys to ctrl, win to ctrl, restore esc and delete +

I think setxkb* works only on X11 and not wayland
Reply With Quote
Reply

Tags
cmd, ctrl, delete, esc, key, keyboard, keys, layout, mapping, restore, win, xkb

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restore Delete instead of CTRL+Delete in Nautilus T3STY Using Fedora 8 21st June 2012 08:12 PM
Emacs and re-mapping Ctrl to Caps Adunaic Using Fedora 1 16th September 2010 04:16 PM
F10 upgrade broke CTRL-key mapping spacelogic Mac Chat 0 18th December 2008 01:33 AM
Mapping combined keys like <Ctrl+C> with xmodmap fedoratocki Using Fedora 4 23rd February 2008 06:06 PM
Mapping Windows Key to Ctrl mauldus Using Fedora 3 15th March 2006 04:57 PM


Current GMT-time: 20:29 (Monday, 24-07-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat