Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Keycodes,scancodes ,how to set them for keyboard backlit

  1. #11
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,044
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Keycodes,scancodes ,how to set them for keyboard backlit

    Bring up calculator and View-->Programming. That brings up a programming calculator with Hex to Dec conversion. c5 is 197.

    Does your laptop have a Fn key? On my thinkpad, I have blue markings on some of my function keys that are activated by pressing Fn-F5--which turns off wireless for instance.

    Typically F1 through F12 are reserved for application quick-keys. So extra laptop functions are handled with a Function-F-key.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  2. #12
    Join Date
    Nov 2010
    Beans
    78

    Re: Keycodes,scancodes ,how to set them for keyboard backlit

    yes it does have an fn key. when I use the other keys f2,f3,f4 etc. I have to use them in combination with fn . so for example to get the screen brightness up i use fn+f4, fn+f3 for screen brightness down, similar for volume. However some keys don't work, keyboard backlight,wireless and fan toggle. I wanted to start with the keyboard backlight (I really need it) and then see if I can adjust the others as well

  3. #13
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,044
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Keycodes,scancodes ,how to set them for keyboard backlit

    So, you need to use xev. Run it and place the mouse cursor in the xev box. Type a few regular keys: a s d f, and you will see keycodes show up in the terminal. Then start typing your Fn keys. The ones that don't show up are ones that are captured by BIOS/ACPI and hidden to the X-server. Any function keys that do show up, note the keycode and use the Keyboard Preferences and assign shortcuts to those keys. You can write a script to turn wireless on and off, turn on fans, lights, just about anything.

    So, if you can see the keys in xev then you can assign shortcuts. If you can't see the keys in xev, then you need to use the ACPI framework, which consists of modifying the scripts that you looked at earlier with the correct keycodes. This takes some trial and error.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  4. #14
    Join Date
    Nov 2010
    Beans
    78

    Re: Keycodes,scancodes ,how to set them for keyboard backlit

    Sorry, your explanations are great and I do understand the logic behind it but I'm confused on how to put all of this into practical.
    In one of my previous posts I've posted the results of the xev command,which are as follow for F9 and F10:

    Code:
    KeyRelease event, serial 41, synthetic NO, window 0x4600001,
        root 0x9b, subw 0x4600002, time 1187461, (38,47), root:(828,99),
        state 0x0, keycode 75 (keysym 0xffc6, F9), same_screen YES,
        XLookupString gives 0 bytes: 
        XFilterEvent returns: False
    
    KeyPress event, serial 41, synthetic NO, window 0x4600001,
        root 0x9b, subw 0x4600002, time 1188081, (38,47), root:(828,99),
        state 0x0, keycode 76 (keysym 0xffc7, F10), same_screen YES,
        XLookupString gives 0 bytes: 
        XmbLookupString gives 0 bytes: 
        XFilterEvent returns: False
    When pressing the fn key,while the xev command was running, I didn't get any result, does that mean that this is picked up by the bios or acpi right?

    What I did next is change the asus_brightnessup and down file by changing the values in it with
    000000c7(for brightness up) and 000000c6 (for brightness down); I thought these are the values tham I'm looking for as they are in the xev results.
    Have I done this right?

    It didn't work, I don't really know where to go from here.

  5. #15
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,044
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Keycodes,scancodes ,how to set them for keyboard backlit

    You are getting closer. The reason the asus_brightness script doesn't work is because you don't have a module loaded into memory that watches for those keys.

    So, leave the keyboard brightness alone for now. What other keys are you trying to activate? Let's get one thing working at a time.

    First the basics, what modules are you running?

    Code:
    lsmod
    I'm running on a Dell Inspiron 600m and it show the following:

    tgalati4@Dell600m-mint14 ~ $ lsmod
    Module Size Used by
    vesafb 13478 1
    arc4 12474 2
    joydev 17162 0
    snd_intel8x0 33107 2
    snd_ac97_codec 105652 1 snd_intel8x0
    ac97_bus 12671 1 snd_ac97_codec
    snd_pcm 80235 2 snd_intel8x0,snd_ac97_codec
    snd_seq_midi 13133 0
    snd_rawmidi 25383 1 snd_seq_midi
    dell_laptop 17162 0
    snd_seq_midi_event 14476 1 snd_seq_midi
    dcdbas 14055 1 dell_laptop
    snd_seq 51281 2 snd_seq_midi,snd_seq_midi_event
    snd_timer 24412 2 snd_pcm,snd_seq
    snd_seq_device 14138 3 snd_seq_midi,snd_rawmidi,snd_seq
    b43 347496 0
    microcode 18210 0
    snd 62146 11 snd_intel8x0,snd_ac97_codec,snd_pcm,snd_rawmidi,sn d_seq,snd_timer,snd_seq_device
    radeon 825498 0
    pcmcia 39545 0
    mac80211 461261 1 b43
    psmouse 89579 0
    cfg80211 175574 2 b43,mac80211
    soundcore 14600 1 snd
    video 18895 0
    snd_page_alloc 14037 2 snd_intel8x0,snd_pcm
    ttm 75535 1 radeon
    serio_raw 13032 0
    drm_kms_helper 47304 1 radeon
    bcma 34484 1 b43
    rfcomm 37277 0
    yenta_socket 27096 0
    pcmcia_rsrc 18192 1 yenta_socket
    bnep 17708 2
    parport_pc 31969 0
    drm 239022 3 radeon,ttm,drm_kms_helper
    i2c_algo_bit 13198 1 radeon
    mac_hid 13038 0
    ppdev 12818 0
    bluetooth 183310 10 rfcomm,bnep
    pcmcia_core 21506 3 pcmcia,yenta_socket,pcmcia_rsrc
    binfmt_misc 17261 1
    lpc_ich 16926 0
    shpchp 32190 0
    p4_clockmod 12829 0
    i8k 13909 0
    lp 13300 0
    parport 40754 3 parport_pc,ppdev,lp
    ssb 50294 1 b43

    So, I have a module that is named dell_laptop and it probably has to do with special functions on dell laptops. To find out if this module has any special switches:

    Code:
    modinfo dell_laptop
    tgalati4@Dell600m-mint14 ~ $ modinfo dell_laptop
    filename: /lib/modules/3.5.0-39-generic/kernel/drivers/platform/x86/dell-laptop.ko
    license: GPL
    description: Dell laptop driver
    author: Matthew Garrett <mjg@redhat.com>
    srcversion: F3778843864566B6FA396E8
    alias: dmi*:svn*DellComputerCorporation*:ct*8*:
    alias: dmi*:svn*DellInc.*:ct*9*:
    alias: dmi*:svn*DellInc.*:ct*8*:
    depends: dcdbas
    intree: Y
    vermagic: 3.5.0-39-generic SMP mod_unload modversions 686

    So no switches, but it does give a location of where the modules are located:

    tgalati4@Dell600m-mint14 /lib/modules/3.5.0-39-generic/kernel/drivers/platform/x86 $ ls
    acerhdf.ko classmate-laptop.ko fujitsu-laptop.ko intel_ips.ko msi-wmi.ko thinkpad_acpi.ko
    acer-wmi.ko compal-laptop.ko fujitsu-tablet.ko intel_menlow.ko mxm-wmi.ko topstar-laptop.ko
    amilo-rfkill.ko dell-laptop.ko hdaps.ko intel_mid_powerbtn.ko panasonic-laptop.ko toshiba_acpi.ko
    apple-gmux.ko dell-wmi-aio.ko hp_accel.ko intel_mid_thermal.ko samsung-laptop.ko toshiba_bluetooth.ko
    asus-laptop.ko dell-wmi.ko hp-wmi.ko intel_oaktrail.ko samsung-q10.ko wmi.ko
    asus-nb-wmi.ko eeepc-laptop.ko ibm_rtl.ko intel_scu_ipcutil.ko sony-laptop.ko xo15-ebook.ko
    asus-wmi.ko eeepc-wmi.ko ideapad-laptop.ko msi-laptop.ko tc1100-wmi.ko

    So you can see a samsung module.

    tgalati4@Dell600m-mint14 /lib/modules/3.5.0-39-generic/kernel/drivers/platform/x86 $ modinfo samsung-laptop
    filename: /lib/modules/3.5.0-39-generic/kernel/drivers/platform/x86/samsung-laptop.ko
    license: GPL
    description: Samsung Backlight driver
    author: Greg Kroah-Hartman <gregkh@suse.de>
    srcversion: FFB59C04A71D56CEEE3ACD6
    alias: dmi*:svn*SAMSUNGELECTRONICSCO.,LTD.*n*N250P*:rn*N250P*:
    alias: dmi*:svn*SAMSUNGELECTRONICSCO.,LTD.*n*N250P*:rn*N250P*:
    alias: dmi*:svn*SAMSUNGELECTRONICSCO.,LTD.*n*NF110/NF210/NF310*:rn*NF110/NF210/NF310*:
    alias: dmi*:svn*SAMSUNGELECTRONICSCO.,LTD.*n*N150/N210/N220*:rn*N150/N210/N220*:
    alias: dmi*:svn*SAMSUNGELECTRONICSCO.,LTD.*n*N145P/N250P/N260P*:rn*N145P/N250P/N260P*:
    alias: dmi*:svn*SAMSUNGELECTRONICSCO.,LTD.*n*N150P*:rn*N150P*:
    alias: dmi*:svn*SAMSUNGELECTRONICSCO.,LTD.*:ct*14*:
    alias: dmi*:svn*SAMSUNGELECTRONICSCO.,LTD.*:ct*10*:
    alias: dmi*:svn*SAMSUNGELECTRONICSCO.,LTD.*:ct*9*:
    alias: dmi*:svn*SAMSUNGELECTRONICSCO.,LTD.*:ct*8*:
    depends: video
    intree: Y
    vermagic: 3.5.0-39-generic SMP mod_unload modversions 686
    parm: forceisable the DMI check and forces the driver to be loaded (bool)
    parm: debugebug enabled or not (bool)

    Unfortunately, this seems to only control the screen backlight.

    I did find this post: http://askubuntu.com/questions/23331...msung-series-9

    Other folks are having problems on Win8 which were fixed by a BIOS flash. So I would suggest updating your BIOS to the latest.

    Try some of these things: https://help.ubuntu.com/community/SamsungSeries9#FnKeys
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  6. #16
    Join Date
    Nov 2010
    Beans
    78

    Re: Keycodes,scancodes ,how to set them for keyboard backlit

    Sorry for the late reply, I was trying to follow the instruction and make it work.

    lsmod didn't give me anything useful so I decided to follow the instructions on the links you've provided. What I got in lsmod was as follow
    Code:
    Module                  Size  Used by
    uvcvideo               80847  0 
    videobuf2_vmalloc      13056  1 uvcvideo
    videobuf2_memops       13202  1 videobuf2_vmalloc
    videobuf2_core         40513  1 uvcvideo
    videodev              129260  2 uvcvideo,videobuf2_core
    bbswitch               13611  0 
    btusb                  22474  0 
    nvram                  14362  0 
    pci_stub               12622  1 
    vboxpci                23194  0 
    vboxnetadp             25670  0 
    vboxnetflt             23479  0 
    vboxdrv               320372  3 vboxnetadp,vboxnetflt,vboxpci
    parport_pc             28152  0 
    ppdev                  17073  0 
    rfcomm                 42641  0 
    bnep                   18036  2 
    snd_hda_codec_hdmi     36906  1 
    bluetooth             228667  12 bnep,btusb,rfcomm
    snd_hda_codec_realtek    78399  1 
    binfmt_misc            17500  1 
    joydev                 17377  0 
    coretemp               13355  0 
    kvm_intel             132891  0 
    kvm                   443165  1 kvm_intel
    ghash_clmulni_intel    13259  0 
    cryptd                 20373  1 ghash_clmulni_intel
    arc4                   12615  2 
    snd_hda_intel          39619  5 
    snd_hda_codec         136498  3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel
    snd_hwdep              13602  1 snd_hda_codec
    snd_pcm                97451  4 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
    iwldvm                241872  0 
    mac80211              606457  1 iwldvm
    snd_page_alloc         18710  2 snd_pcm,snd_hda_intel
    snd_seq_midi           13324  0 
    snd_seq_midi_event     14899  1 snd_seq_midi
    snd_rawmidi            30180  1 snd_seq_midi
    microcode              22881  0 
    iwlwifi               173516  1 iwldvm
    i915                  600349  3 
    lpc_ich                17061  0 
    snd_seq                61554  2 snd_seq_midi_event,snd_seq_midi
    psmouse                95905  0 
    cfg80211              510937  3 iwlwifi,mac80211,iwldvm
    snd_seq_device         14497  3 snd_seq,snd_rawmidi,snd_seq_midi
    serio_raw              13215  0 
    snd_timer              29425  2 snd_pcm,snd_seq
    drm_kms_helper         49394  1 i915
    snd                    68876  19 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec,snd_hda_intel,snd_seq_device
    drm                   286028  4 i915,drm_kms_helper
    mei                    41158  0 
    soundcore              12680  1 snd
    i2c_algo_bit           13413  1 i915
    nls_iso8859_1          12713  1 
    video                  19390  1 i915
    wmi                    19070  0 
    mac_hid                13205  0 
    lp                     17759  0 
    parport                46345  3 lp,ppdev,parport_pc
    ahci                   25731  4 
    libahci                31364  1 ahci
    r8169                  67466  0

    After following the instructions on the link you've provided, I get the logo of the screen keyboard brightness,which stays always to full but the keyboard doesn't lit up.
    Even using alt+F4 for some reasons doesn't work(to close windows, folders etc)
    Here's the keymapping:


    Code:
    0xCE prog1              
    0x89 brightnessdown   
    0x88 brightnessup
    0x82 switchvideomode
    0xF9 f23
    0xA0 mute
    0xAE volumedown
    0xB0 volumeup
    0x97 kbdillumdown
    0x96 kbdillumup
    0xB3 prog3
    0xD5 wlan
    As you can see from the pic below, when I press FN+F9 or FN+F10, I get the same logo of the keyboard with full bar (ignore the fan logo)
    [IMG][/IMG]


    Any advice on what I'm doing wrong here?
    plus, is it possible to update the bios without having windows installed?

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •