Announcement

Collapse
No announcement yet.

Mapping a keyboard button to a function

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: Mapping a keyboard button to a function

    It's not mounted on, or near the touch pad, but it could be wired to it I suppose. The button is on the left hand side of the laptop, next to my vol + & -, head phones & Mic jacks. Do you think this could be the case? Any ideas how I can check this?
    I have a mind like a steel trap. Stuff gets in there and WHAM! it never gets back out again.

    Comment


      #17
      Re: Mapping a keyboard button to a function

      After googling long and hard, I have come across this post:

      http://www.linuxpackages.net/forum/v...affbf3fb3afe0c

      The interesting bit is this:

      ----------------------------------------------------------------------------------------------------------------------------
      It does appear to be a known problem with the 2.6 kernel. On my logitech keyboard, I got around the problem using setkeycodes, as below.

      First press one of the non functioning keys. Then take a look at /var/log/syslog. Towards the bottom, you should find something along the lines of the following:

      Code:

      Jul 31 07:35:52 proton kernel: atkbd.c: Unknown key pressed (translated set 2, code 0x85 on isa0060serio0).
      Jul 31 07:35:52 proton kernel: atkbd.c: Use 'setkeycodes e005 <keycode>' to make it known.
      Jul 31 07:35:52 proton kernel: atkbd.c: Unknown key released (translated set 2, code 0x85 on isa006/serio0).
      Jul 31 07:35:52 proton kernel: atkbd.c: Use 'setkeycodes e005 <keycode>' to make it known.


      Then run getkeycodes. This lists the currently assigned keycodes with output similar to the following:

      Code:

      Plain scancodes xx (hex) versus keycodes (dec)
      for 1-83 (0x01-0x53) scancode equals keycode

      0x50: 80 81 82 83 99 0 86 87
      0x58: 88 117 0 0 95 183 184 185
      0x60: 0 0 0 0 0 0 0 0
      0x68: 0 0 0 0 0 0 0 0
      0x70: 93 0 0 89 0 0 85 91
      0x78: 90 92 0 94 0 124 121 0

      Escaped scancodes e0 xx (hex)

      e0 00: 0 0 0 0 0 0 0 0
      e0 08: 0 0 0 0 0 0 0 0
      e0 10: 165 0 0 0 0 0 0 0
      e0 18: 0 163 0 0 96 97 0 0
      e0 20: 113 140 164 0 166 0 0 0
      e0 28: 0 0 255 0 0 0 114 0
      e0 30: 115 0 150 0 0 98 255 99
      e0 38: 100 0 0 0 0 0 0 0
      e0 40: 0 0 0 0 0 119 119 102
      e0 48: 103 104 0 105 112 106 118 107
      e0 50: 108 109 110 111 0 0 0 0
      e0 58: 0 0 0 125 126 127 116 142
      e0 60: 0 0 0 143 0 217 156 173
      e0 68: 128 159 158 157 155 226 0 112
      e0 70: 0 0 0 0 0 0 0 0
      e0 78: 0 0 0 0 0 0 0 0


      Then it is simply a case of making the unrecognised key known by finding an unassigned keycode (in this case I chose 154), and assigning it using setkeycodes:

      Code:
      n I look in the log there is no mention of
      setkeycodes e005 154


      Restart X, and xev should now detect the keypress.

      ----------------------------------------------------------------------------------------------------------------------------

      However when I look in the syslog I don't get an unknown keypress.
      I have a mind like a steel trap. Stuff gets in there and WHAM! it never gets back out again.

      Comment


        #18
        Re: Mapping a keyboard button to a function

        Notice the date on that exchange. There have been tremendous changes in the linux kernel since 2004. Particularly since you are seeing no messages in /var/log/syslog, I would think this is entirely different.

        Comment


          #19
          Re: Mapping a keyboard button to a function

          This appears to be very much the same thing.
          https://bugs.launchpad.net/ubuntu/+s...al/+bug/120856

          Comment


            #20
            Re: Mapping a keyboard button to a function

            This is probably of interest. The package console-setup sets up the console, duh! If you run

            sudo dpkg-reconfigure console-setup

            Youwill see many possibilities to choose from. One of those is
            Laptop/notebook Compaq (eg. Presario) Internet Keyboard

            I think this might activate you button. Then again , it might not.

            Comment


              #21
              Re: Mapping a keyboard button to a function

              Hi all.

              I tried the "sudo dpkg-reconfigure console-setup" and went through the process of setting up, selecting "Laptop/notebook Compaq (eg Presario) Internet Keyboard", an at the end of the setup I got this:

              -----------------------------------------------------------------------------------------------------------------------------
              laptop@Laptop:~$ sudo dpkg-reconfigure console-setup
              [sudo] password for laptop:
              * Saving console font and keymap for next boot...WARNING: Undefined kernel key code for 148
              WARNING: Undefined kernel key code for 152
              WARNING: Undefined kernel key code for 153
              WARNING: Undefined kernel key code for 158
              WARNING: Undefined kernel key code for 159
              WARNING: Undefined kernel key code for 160
              WARNING: Undefined kernel key code for 162
              WARNING: Undefined kernel key code for 163
              WARNING: Undefined kernel key code for 164
              WARNING: Undefined kernel key code for 174
              WARNING: Undefined kernel key code for 176
              WARNING: Undefined kernel key code for 178
              WARNING: Undefined kernel key code for 223
              WARNING: Undefined kernel key code for 245
              [ OK ]
              update-initramfs: Generating /boot/initrd.img-2.6.27-11-generic
              laptop@Laptop:~$

              -----------------------------------------------------------------------------------------------------------------------------

              I restarted the laptop and tried the mute key and nothing happened. I opened a terminal and used xev to see if I was now getting any key code, and again nothing. Since this my left hand "alt" key has stopped working, although it does give out a key code in xev. I think going back to the my previous set-up would solve the alt key though.

              Any idea what all the warnings are for? It sounds like I have 14 keys that don't work, but this isn't so. I checked all my extra keys (Never thought to checked them before, don't ask me why).

              The keys which don't give any keycode are as follows:

              Mute (A mute symbol)
              Search (A magnifying glass)
              Lock (A locked padlock symbol)
              Help (A question mark)

              however the following keys give a keycode in xev, but are as yet not assigned to anythng:

              Mail (A picture of an envelope)
              Information (An information logo, "i")

              My additional volume up / down keys work fine.
              I have a mind like a steel trap. Stuff gets in there and WHAM! it never gets back out again.

              Comment


                #22
                Re: Mapping a keyboard button to a function

                Like you said mando_hacker, this bug is simular to the problem I am having:

                https://bugs.launchpad.net/ubuntu/+s...al/+bug/120856

                Also found this, but no reply as yet:

                https://bugs.launchpad.net/ubuntu/+bug/296507

                Does this look like a problem with the kernel, with no work around as of yet?
                I'm starting to lose hope.
                I have a mind like a steel trap. Stuff gets in there and WHAM! it never gets back out again.

                Comment


                  #23
                  Re: Mapping a keyboard button to a function

                  I think you have reached a point where what you want has never shown up on a kernel developers radar. I expect that the right person could probably provide a fix in short order with hardware to work with. It is just not easy to engineer that situation. So it is probably time to think of it as a long term project and keep noticing until it gets implemented.

                  Comment

                  Working...
                  X