Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This is something I've been struggling with for awhile. I've read various sites and threads on this site about KDE and gnome tools, kdb, xmodmap, etc., but haven't found anything that will do exactly what I want. I'm willing to spend a bit of time tinkering to get this to work, but I don't want to plunge in and start changing things I don't understand. I'll explain what I'm looking for, and I'd appreciate it if someone can at least get me started with what I need to do on my particular system.
I'd like to be able to use my keyboard exactly as the default US layout works with a few exceptions. Specifically, I'd like to be able to use the five spanish accented vowels, question mark, exclamation point, and n-tilde as well as the three accents used in Finnish (two dots over "a" and "o" and the Swedish "a" with a circle over the letter). I'd prefer if I could have this all rolled into one rather than having to switch layouts to be able to type other letters. Since, if I understand correctly, the left and right alt keys are independent of each other, I'd like to use right-alt to accomplish this. I don't like the "dead key" setup, and I want the single quote key to work just as it does in a normal US layout, and I don't want to have to press and release alt and then press and release another key. Just as in normal keystrokes such as <ctrl-a>, I'd like to use right-alt plus a vowel, n, exclamation point, or question mark to get the lowercase accented version, and right-alt plus shift plus one of those to get the uppercase letter. To get the Finnish and Swedish characters, I could just assign those to another letter (s, d, and f, for example), and use the same right-alt or right-alt + shift combinations to get those. Finally, I have swapkeys enabled so my caps lock and control keys are switched, and I'd like that to stay the way it is. In the past, when I've messed with these keyboard layouts I always seem to disable that functionality. This sounds like a lot as I'm typing it out, but it really isn't that complex and it seems it would be possible to do. The only part I haven't seen anywhere is using the right-alt key like any other keystroke instead of pressing and releasing it before pressing the other letter, and it's fine if I can't get this to work as long as using shift to get the uppercase letters can be figured in somehow.
At this point, I really have no idea how to use xmodmap and the other tools to accomplish this the right way, and I thought someone in this forum would be able to help me or give me a head start. I appreciate your help in advance.
Thanks for the link. I'd seen that page before but apparently didn't look at it in detail. I followed the directions and changed the symbols file they provided to accomodate the other changes I wanted made. I then named it "uscustom" and included a Xkblayout line in my XF86Config line pointing to that file. I then restarted X and tried to type, but everything was as it was before with the normal "us" layout even though it should be looking at the other file. Any ideas as to what could be causing this?
I'm using Slackware and Fluxbox, no KDE here at all. The terminal has nothing to do with it, as it doesn't work in the terminal or in other programs (and these keyboard layouts should affect everything you type in X, correct?). Thanks for the ideas though. Any other ideas as to why this isn't working? I've double and triple checked the changes I made to the uscustom symbols file and made sure it was set in XF86Config, but it isn't working the way it should.
I was able to resolve one part of this problem when I was looking at the X messages outputted on the first virtual terminal. For some reason it wanted the uscustom file within the pc directory rather than in the normal symbols directory as that spanish page said. Now my Caps Lock and Control mappings that I put in that file work fine, but alt plus a letter doesn't do anything (ralt acts as another alt key that can select menus, etc.). I'm not familiar enough with these files to see how this works, but that site made it sound like their pre-made one was enough (and it isn't working). Does anyone know how to use these symbol files with right-alt?
EDIT:
One more note... I've played around with this file even more and it seems I have a better idea of what the problem is but still no idea how to solve it. I've tried changing between the different model sections of the symbol file but even pc101compose doesn't work. I looked around online and Mod3 is listed as being what you need to map to get those third and fourth entries in the table at the beginning of the file, but that doesn't seem to work either. I just want to know how to get those third and fourth symbols to print, but it seems like I've tried everything and they never show up no matter what key combinations I use. This is getting very frustrating. Can anyone give me a specific response as to how I get those symbols?
Well, I finally figured it out. For some strange reason the right alt key wasn't getting set properly in the symbols file, so I created a .Xmodmap with "keycode 113 = Mode_switch" and changed my .xinitrc to "xmodmap .Xmodmap" on startup. Thanks all for your help in getting me to this point. Everything works exactly as I explained above, and there's no need to ever change keyboard layouts like I had to do under Windows.
Sure. I'm not sure if I remember exactly what I did, but I'll tell you what I remember
First I copied the /etc/X11/xkb/symbols/pc/us to a file called "uscustom" so I could work with that and not mess up my original us symbols file. I then made the changes to that file (see the link given above and the example symbols file for how to do that). Then I added the line:
Code:
Option "XkbLayout" "uscustom"
to my XF86Config file so it uses that instead of the default us one. Then I was able to find a Xmodmap file on my system that was automatically loaded from my ~/.xinitrc file. I can't figure out exactly how that works now, but I know it will also work if you create a ~/.Xmodmap file with the following line:
Code:
keycode 113 = Mode_switch
and then put
Code:
xmodmap .Xmodmap
in your ~/.xinitrc file.
Hope this helps, let me know if anything needs clarifying.
This probably isn't much help now that you've found a solution, but I recently was messing around with ways to enter "odd" characters into a terminal. What I ended up doing was creating envronment variables in .bash_profile:
c_AE=Æ
c_Ao=Å
c_ao=å
...
export c_AE c_Ao c_ao ....
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.