[SOLVED] Remapping keys using udev hwdb doesn't work on rightAlt

hi, I had posted this topic in the [ newbie corner ] subforum for days, but got no repliy. I hope I can find luck  here.
I'm trying to use udev hwdb for swapping pairs of keys ( esc, caps_lock ) and ( rightAlt , rightCtrl ) . I followed the instruction here Map Scancodes to Keycodes   with procedures describe blow. I only succeed in exchanging pair (esc, caps_lock) but failed in (rightAlt, rightCtrl).
Details of Procedures:
Create an empty file under /usr/lib64/udev/hwdb.d with file name 90-custom-keys.hwdb . Add the following lines into this file.
keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pn*
KEYBOARD_KEY_01=capslock
KEYBOARD_KEY_3a=esc
KEYBOARD_KEY_e038=rightctrl
KEYBOARD_KEY_e01d=rightalt
Rebuilding hwdb.bin
udevadm hwdb --update
Testing and reboot my system
udevadm --debug test /devices/platform/i8042/serio0/input/input0/event0
udevadm --debug test-builtin keyboard /devices/platform/i8042/serio0/input/input0/event0
Parts of the testing result of the last command looks like
device 0x1ce3890 has devpath '/devices/platform/i8042/serio0/input/input0/event0'
device 0x1ce3890 filled with db file data
keyboard: mapping scan code 1 (0x1) to key code 58 (0x3a)
keyboard: mapping scan code 58 (0x3a) to key code 1 (0x1)
keyboard: mapping scan code 129 (0x81) to key code 164 (0xa4)
keyboard: mapping scan code 130 (0x82) to key code 166 (0xa6)
keyboard: mapping scan code 164 (0xa4) to key code 166 (0xa6)
keyboard: mapping scan code 216 (0xd8) to key code 152 (0x98)
keyboard: mapping scan code 217 (0xd9) to key code 191 (0xbf)
keyboard: mapping scan code 57373 (0xe01d) to key code 100 (0x64)
Error calling EVIOCSKEYCODE: Invalid argument
keyboard: mapping scan code 57400 (0xe038) to key code 97 (0x61)
Error calling EVIOCSKEYCODE: Invalid argument
keyboard: mapping scan code 237 (0xed) to key code 226 (0xe2)
unload module index
Thie last 6 lines seems to be complaining the  problem, saying that 0xe038  and 0xe01d are invalid scancodes.
But they are scancodes of rightAlt and rightCtrl respectively, which I got from
showkey -s
After rebooting the system with the above settings, esc works as caps_lock and caps_lock works as  esc but  rightAlt and rightCtrl has no changes.
Last edited by kejingzhang (2013-10-10 02:32:29)

Thanks plam and Raynman for your help . Follow your hints, I succeed the swapping key task in an alternative method.
Using the command 'setkeycodes' and adding these commands into a systemd controlled service script, keymaps are exchanged as gdm started.
Here is my script and steps for doing this.
Created a file with filename custom-keys.service under /etc/systemd/system. Add the  following context to the file.
[Unit]
Description=Keymap Custom
Requires=gdm.service
After=gdm.service
[Service]
Type=oneshot
ExecStart=/usr/bin/setkeycodes 1 58
ExecStart=/usr/bin/setkeycodes 3a 1
ExecStart=/usr/bin/setkeycodes e01d 100
ExecStart=/usr/bin/setkeycodes e038 97
[Install]
WantedBy=graphical.target
Enable the script so setkeycodes commands will automatically executed when gdm starts
systemctl enable custom-keys
The next time you reboot your system, key changes will take effect. To test if your config works, try
systemctl start custom-keys

Similar Messages

  • Remapping keyboard keys using udev hwdb doesn't work on rightAlt

    Hi,
    I'm trying to use udev hwdb for swapping pairs of keys ( esc, caps_lock ) and ( rightAlt , rightCtrl ) . I followed the instruction here Map Scancodes to Keycodes   with procedures describe blow. I only succeed in exchaging pair (esc, caps_lock) but failed in (rightAlt, rightCtrl).
    Details of Procedures:
    Create an empty file under /usr/lib64/udev/hwdb.d with file name 90-custom-keys.hwdb . Add the following lines into this file.
    keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pn*
    KEYBOARD_KEY_01=capslock
    KEYBOARD_KEY_3a=esc
    KEYBOARD_KEY_e038=rightctrl
    KEYBOARD_KEY_e01d=rightalt
    Rebuilding hwdb.bin
    udevadm hwdb --update
    Testing and reboot my system
    udevadm --debug test /devices/platform/i8042/serio0/input/input0/event0
    udevadm --debug test-builtin keyboard /devices/platform/i8042/serio0/input/input0/event0
    Parts of the testing result of the last command looks like
    device 0x1ce3890 has devpath '/devices/platform/i8042/serio0/input/input0/event0'
    device 0x1ce3890 filled with db file data
    keyboard: mapping scan code 1 (0x1) to key code 58 (0x3a)
    keyboard: mapping scan code 58 (0x3a) to key code 1 (0x1)
    keyboard: mapping scan code 129 (0x81) to key code 164 (0xa4)
    keyboard: mapping scan code 130 (0x82) to key code 166 (0xa6)
    keyboard: mapping scan code 164 (0xa4) to key code 166 (0xa6)
    keyboard: mapping scan code 216 (0xd8) to key code 152 (0x98)
    keyboard: mapping scan code 217 (0xd9) to key code 191 (0xbf)
    keyboard: mapping scan code 57373 (0xe01d) to key code 100 (0x64)
    Error calling EVIOCSKEYCODE: Invalid argument
    keyboard: mapping scan code 57400 (0xe038) to key code 97 (0x61)
    Error calling EVIOCSKEYCODE: Invalid argument
    keyboard: mapping scan code 237 (0xed) to key code 226 (0xe2)
    unload module index
    Thie last 6 lines seems to be complaining the  problem, saying that 0xe038  and 0xe01d are invalid scancodes.
    But they are scancodes of rightAlt and rightCtrl respectively, which I got from
    showkey -s
    After rebooting the system with the above settings, esc works as caps_lock and caps_lock works as  esc but  rightAlt and rightCtrl has no changes.
    Last edited by kejingzhang (2013-10-04 08:51:59)

    For USB keyboard, you need to get the scancodes from evtest rather than showkey. You may find a solution from:
    https://ask.fedoraproject.org/en/questi … -keycodes/

  • Creating a script for a PRIMARY KEY USING INDEX SORT doesn't work

    Probably a bug.
    h1. Environment
    Application: Oracle SQL Developer Data Modeler
    Version: 3.0.0.655
    h1. Test Case:
    1. Create a new table TRANSACTIONS with some columns.
    2. Mark one of numeric columns as the primary key - PK_TRANSACTIONS.
    3. Go to Physical Models and create new Oracle Database 11g.
    4. Go to Physical Models -> Oracle Database 11g -> Tables -> TRANSACTIONS -> Primary Keys -> PK_TRANSACTIONS -> Properties:
    a) on General tab set Using Index to BY INDEX NAME
    b) on Using Index tab choose a tablespace
    c) on Using Index tab set Index Sort to SORTED.
    5. Export the schema to DDL script. For the primary key you will get something like this:
    ALTER TABLE TRANSACTION
    ADD CONSTRAINT PK_TRANSACTION PRIMARY KEY ( TRAN_ID ) DEFERRABLE
    USING INDEX
    PCTFREE 10
    MAXTRANS 255
    TABLESPACE TBSPC_INDX
    LOGGING
    STORAGE (
    INITIAL 65536
    NEXT 1048576
    PCTINCREASE 0
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    FREELISTS 1
    FREELIST GROUPS 1
    BUFFER_POOL DEFAULT
    ) SORTED
    h1. Reason of failure
    The script will fail because SORTED is not allowed here. It should be SORT.
    Additionally, the default behaviour for Data Modeler is to set Index Sort to NO but default setting for Oracle database 11g is SORT. Shouldn't Data Modeler use SORT as the default value?
    Edited by: user7420841 on 2011-05-07 03:15

    Hi,
    Thanks for reporting this problem. As you say, it should be SORT rather than SORTED. I have logged a bug on this.
    I also agree that, for consistency with the database default, it would be better to have SORT as the default in Data Modeler.
    David

  • [solved] remap keys in pager less

    Hi,
    less seems to be the most common pager for cli and is very convenient, as it has vim-keybindings for movement.
    However, I changed my keyboard layout, so that j and k are no longer lying at their querty-Positions.
    Is there a way to remap keys in less or do I have to modify the sourcecode and build it on my own?
    Thanks in advance!
    Last edited by Ovion (2013-10-01 17:07:32)

    lesskey might be what you're looking for.
    DESCRIPTION
    Lesskey is used to specify a set of key bindings to be used by less.

  • Two Finger Scrolling using track pad doesn't work.

    You know how you can drag 2 fingers down the track pad to sroll down a page. Well, it doesn't work for me using Vista through Boot Camp. I tried the update, but it wouldn't install.
    Is this as good as it gets?
    Hypnoguy

    Hypnoguy,
    Sorry I haven't used boot camp for a long time my memory is a little fuzzy. Also note I used it with XP and not Vista, but don't use it at the moment anymore.
    Here is a list of Supported Macs for 64-bit windows: http://support.apple.com/kb/HT1846
    As per your trackpad problems after the drives have been installed I would try to install the update again: http://support.apple.com/kb/HT3336
    Here are the boot camp updates and also may help with errors:
    64 bit: http://support.apple.com/downloads/BootCamp_Update_2_1_for_Windows_Vista64
    32 bit: http://support.apple.com/downloads/BootCamp_Update_2_1_for_Windows_Vista32
    Also I would look in the boot camp system tray tool to see if there are settings related to your function keys.
    Sorry I don't know of a function key that changes the startup volume, I only know of the select from the boot camp system tray (Windows)/Startup disk preference pane (Mac) or the hold option during startup. More on that here http://docs.info.apple.com/article.html?path=Mac/10.5/en/11892.html
    A good place to find a lot of Bootcamp support would be here: http://www.apple.com/support/bootcamp/
    Hope that helps,
    Weston

  • Own udev rule doesn't work at all

    Hi,
    I've trouble to write my own udev rule. I tried the following but it doesn't work at all.
    I created the following file /etc/udev/rules.d/90-monitor-hotplug.rules with the following content:
    # test
    SUBSYSTEMS="usb", RUN+="/bin/sh -c '/bin/echo mon >> /tmp/monitor.log'"
    run
    > udevadm control --reload
    Now I assumed with every usb event, e.g plugin of an usb memory stick it should  spam something in /tmp/monitor.log
    But nothing happens.
    Can anybody tell me what I'm doing wrong. I guess it's something really stupid.
    Thanks
    Jakob

    You haven't used an equality operator in your first line (2x "="). Other than that, it looks fine to me.
    So try:
    # test
    SUBSYSTEMS=="usb", RUN+="/bin/sh -c '/bin/echo mon >> /tmp/monitor.log'"
    run
    > udevadm control --reload

  • [SOLVED]mounting cdrom and usb devices doesn't work

    Hello,
    i have trouble mounting my usb devices. automount doesn't work and i can't mount them manually even as a superuser. here's the output of mount command:
    mount: wrong fs type, bad option, bad superblock on /dev/sdc,
    missing codepage or helper program, or other error
    In some cases useful info is found in syslog - try
    dmesg | tail or so
    i can mount cdrom manually but i can't do the same for my usb stick and external hard drives. it always complains about the above regardless of the filesystem. my devices are working under windows and other linuxes so i know hardware is not the problem.
    i'm using lxde with pcmanfm.
    if you need any other files just ask.
    thanks
    Last edited by the gray (2009-03-16 20:15:18)

    above was the error when i tried to mount any usb device with "mount -t <type> /dev/sdc /media/mountpoint". and i couldn't mount any usb device as root from console. when i tried to mount devices using pcmanfm it just popped some empty dialogs and i couldn't find any mention of "IsCallerPriviliged failed" error so i (wrongly) presumed it wasn't that. i did try some of the other fixes mentioned in the forum with no success. but adding exec ck-launch-session startkde to my .xinitrc fixed the issue
    thanks again
    Last edited by the gray (2009-03-16 20:17:53)

  • Many programs I used to use in Tiger doesn't work in Leopard

    Here are the ones I've noticed have not been working or have errors:
    iMovie
    iChat
    Yahoo Messenger
    Adium
    VisualHub
    There are probably like 10 more but I haven't seen it yet. Why are so many programs are acting like this. I was thinking it was becasuse it wasn't ugpraded enough but I did install the newer version and it doesn't work.

    Well, haven't we had to deal with a slew of updates every two years?
    And at least Vista x64 is probably more secure, supports EFI (UEFI 2.).
    The same people that would need a Mac Pro (dual cpu, 8GB RAM, etc) would be looking at 64-bit.
    Did not Apple tout the G5 from IBM as finally being a 64-bit system? But yes, even Adobe CS3 is still 32-bit and limited to 3.5GB of user space, which there are work arounds for.
    One person I tried to help was using Maya but his version doesn't work with Leopard, and blames Apple and 10.5 it seems, rather than realize he needs to consider an 8-core system rather than 4-core, more memory, make better use of disk and RAID, and of course... upgrade software or... WAIT FOR MAYA AND 10.5.x to catch up to each other!
    People assume you have to wait for SP1 for Windows, but think they should jump rigtht in, when we all have seen that X.3 is usually the first "sweet spot" in any release.

  • [solved]amarok-2.5.0-2 doesn't work

    i use Arch Linux x86_64 with the latest kernel from core, it's the 3.2.8, and KDE 4.8.0, Qt 4.8 with ffmpeg 20120127-3. My problem is when i try to run amarok it says "amarok: error while loading shared libraries: libavcodec.so.52: cannot open shared object file: No such file or directory" i made a symlink for libavcodec.so.53 but still doesn't work. I couldn't find anything in this topic. I try to compile the git version from AUR but it's the same.
    Last edited by hg2rbw (2012-03-03 07:55:07)

    What's the output of
    LD_DEBUG=files amarok > amarok.log 2>&1 && grep libavcodec amarok.log

  • My return key on Macbook pro doesn't work

    My return key on Macbook Pro stopped working, also the shift key

    Hello there,
    It sounds like the return key is not working on your computers built in keyboard. I would use these steps from the following article to help isolate and resolve the issue:
    Try logging into a different user account. If the issue does not occur when logged into a different user account, then troubleshoot for software issues.
    You may have accidentally set an option that changes how your keyboard operates.
    Choose Apple menu > System Preferences, click Dictation & Speech, and then click “Text to Speech.” If “Speak selected text when the key is pressed” is selected, deselect it or press Set Key to select another key.
    Choose Apple menu > System Preferences, click Accessibility, and then click Keyboard. Make sure Slow Keys is turned off. If Slow Keys is on, you must hold down a key longer than usual before it’s recognized.
    Choose Apple menu > System Preferences, click Language & Text, and then click Input Sources. Select the checkbox next to Keyboard & Character Viewer, and then select “Show Input menu in menu bar.” Open the Input menu and make sure the correct keyboard layout is selected. To see the keyboard layout, choose Show Keyboard Viewer from the Input menu.
    From: OS X Mountain Lion: If keys on your keyboard don’t work
              http://support.apple.com/kb/PH10680
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • Problem with Internet Key Onda Mt835Up: It doesn't work with mac os 10.6.6

    Hi I have a problem with internet key Onda MT835UP. It doesn't work, because my imac is more new than internet key.
    Can you help me? Can you send me the upgrade for this internet key?
    Thanks

    I have called Onda, there isn't the driver for Mac OS X 10.6.7 and they don't know if it'll be released.
    So if you have a Mac it's better to not buy Onda internet key,
    instead it's better to choose other brands that update the drivers of their products.

  • [SOLVED] xfce 4.8 = auto mount doesn't work at boot

    Hi
    I installed arch linux with xfce as DE. auto mount doesn't work at boot. I read the wiki about policykit and I have
    ck-launch-session
    at my .xinitrc but still no luck. I have dbus running as a daemon and my user belong to appropriate groups (storage and ...)
    I don't want to use auto mount rules instead of xfce auto mount.
    thanks in advanced
    Last edited by sasy360 (2011-07-02 03:16:35)

    Jodell wrote:Do you have gvfs installed?
    Oh that was all. thanks!
    Did you read the wiki entry for Xfce?
    yes but it did not mention to install gvfs.

  • Programmatic security using isCallerInRole(roleName) doesn't work

    Hi,
    I am developing an EJB application on WebAS 6.40 SP16 and try to use declarative and programmatic security combined. I have conducted the following steps to map a UME group to an j2ee ejb role:
    - Mapped a new Security Role (SR_ProductAdmin) to the UME Administrators group using the Visual Administrator(Services/Security Provider/Security Roles).
    - Mapped the Security Role to an EJB Application Security Role in ejb-j2ee-engine.xml
    <ejb-j2ee-engine>
      <security-permission>
        <security-role-map>
          <role-name>ProductAdmin</role-name>
          <server-role-name>SR_ProductAdmin</server-role-name>
        </security-role-map>
      </security-permission>
    </ejb-j2ee-engine>
    - Added the role in ejb-jar.xml/Assembly/security-role
    - Enforced descriptive security in ejb-jar.xml/Assembly/method-permission on my EJB. This works as expected, only members of the administrators group can access the EJB.
    - Added another role mapped to the J2EE Security Role "all" and added it to  ejb-jar.xml/Assembly/method-permission to allow some methods of the EJB to be invoked by everyone, security checking is based on parameters and done programmatically at runtime.
    - I have mapped the ProductAdmin in ejb-jar.xml/Enterprise Beans/session beans/security-role-ref as described in the Developer Studio manual.
    <security-role-ref>
      <role-name>ProductAdminInternal</role-name>
      <role-link>ProductAdmin</role-link>
    </security-role-ref>
    - I should be able to check the role of the caller using the Context.isCallerInRole(String roleName) but it always returns false for roleName="ProductAdminInternal". In the same context I can invoke Context.getCallerPrincipal().getName() and get (correctly) the user name "Administrator".
    Thanks in advance,
    Stefan

    Hi Frank,
    When using the Must value authentication worked but when using the Auth value it didn't.
    Now I've found what the problem was.
    I had to define the users and role in %JDEV_HOME%\j2ee\home\config\system-jazn-data.xml. I had setup my users in several jazn files but this one. It's pretty hard to find in which xml file you have to define users and roles. I don't understand either why switching from Must to Auth makes the authentication using different jazn files...
    Now I have to test in an OC4J standalone instance.
    Thanks,
    Seb.

  • [solved] cryptkey /dev/disk/by-uuid doesn't work - udev does?!

    Hello,
    I have a cryptkey="/dev/disk/by-uuid/...:start:offset" option in my grub.cfg
    This one doesnt work (no keyfile found).
    But when I create a udev-rule which makes the device appear as /dev/foo (and add it to mkinitcpio.conf), the following works:
    cryptkey="/dev/foo:start:offset"
    on the other side, cryptdevice="/dev/disk/by-uuid/..." works fine.
    So why can't I use the first option but have to setup this rule instead?
    Or did I forget something?
    Last edited by weltio (2013-05-30 19:29:07)

    Oh - no iam just retarded. The device /dev/sdb doenst have a uuid... of course not. So i guess the udev solution is the only possible one.

  • My key scrambler add-on doesn't work anymore in Firefox v21!!!

    my key scrambler worked in v19 ok but not when auto upgrade occurred yesterday.
    It doesn't even appear in add-on list.
    I searched for it using Tools-Add-ons menus but key scrambler isn't even there.
    Is this part of US Government NSA Surveillance??
    Right now I'm just going to use Google Chrome browser as it works perfectly there!!!!

    Is your key scrambler a plugin? Check out this article about a change in where Firefox looks for plugins that can cause a few plugins to disappear.
    [[Windows Media or other plugins stopped working after Firefox update]]
    Does that solve it?

Maybe you are looking for

  • IPhone 5s Voice Call Issues

    I've had an iPhone 5s (upgraded to 8.1.3) since mid-November and have been experiencing difficulties on voice calls ever since (I switched carriers as well). When calling specific contacts (family, friends etc.), the calls sound as though as I am on

  • Apex collection.........

    i have put the below coding in application process. Using Ajax i call this process and tried to run and get the value from the collection book and display it a field. but the the value *'a'* is not storing in p_c001. How to find whether below coding

  • WF notification response preferance

    Hi, In WF mail notification, there are two ways to respond. Either 1) it gives "Please click here to Respond" link at end , OR 2) it gives "Action: Approve Reject Request Information" which basically invokes e-mail client to reply. Which profile opti

  • Google services not working on my wifi. Help !!

    Hello experts, I recently bought my new Macbook Air and updates it to mavericks 10.9.4 through the wifi at my home. 1. Now I am in my college and we connect to wifi through proxies. But not I am having trouble opening google.com , gmail , youtube and

  • Is there any place somewhere to submit ideas about...

    Hi, all the message is in the title. Thanks.