RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Force [NumLock] On Boot Of RetroPie?

    Scheduled Pinned Locked Moved Help and Support
    14 Posts 5 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      JeZxLee
      last edited by

      Hi,

      I've got RetroPie running on a RPi2.
      I need to have [NumLock] turned on when the RetroPie OS boots.
      How can I easily configure RetroPie to have [NumLock] on when OS boots?
      Thanks!

      Jesse

      1 Reply Last reply Reply Quote 0
      • senkunS
        senkun
        last edited by

        /etc/kbd/config

        uncomment #LEDS=+num

        J 1 Reply Last reply Reply Quote 0
        • J
          JeZxLee @senkun
          last edited by

          @senkun said in Force [NumLock] On Boot Of RetroPie?:

          /etc/kbd/config

          uncomment #LEDS=+num

          Hi,

          Thanks for the reply.
          How can I edit "/etc/kbd/config" from within RetroPie?
          All my computers run Windows 10 so I would need to do above from within RetroPie.
          Thanks!

          Jesse

          1 Reply Last reply Reply Quote 0
          • senkunS
            senkun
            last edited by

            quit emulationstation (start brings up the menu), now you should be in command line

            type sudo nano /etc/kbd/config

            scroll down find #LEDS=+num it's the second last entry, then delete the hash and make it LEDS=+num

            press ctrl+x then y then enter

            sudo reboot

            1 Reply Last reply Reply Quote 0
            • C
              challenger2010
              last edited by

              This is an old thread, but I needed to figure out how to do this with Stretch. Below is what I found, but I have not tried it yet:

              To turn Numlock on at startup (on Raspbian Stretch) :
              sudo apt-get install numlockx

              sudo nano /usr/share/lightdm/lightdm.conf.d/01_debian.conf
              At the end, add

              greeter-setup-script=/usr/bin/numlockx on
              Save. Reboot. Yer Done.

              mituM 1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @challenger2010
                last edited by

                @challenger2010 said in Force [NumLock] On Boot Of RetroPie?:

                greeter-setup-script=/usr/bin/numlockx on
                Save. Reboot. Yer Done.

                Not really, RetroPie doesn't come with an X environment, what you posted works only when starting an X session from LightDM.

                jonnykeshJ 1 Reply Last reply Reply Quote 0
                • jonnykeshJ
                  jonnykesh @mitu
                  last edited by jonnykesh

                  @mitu @challenger2010 If you are booting into the command line interface then this should work.

                  Optionally Boot with Numlock On
                  
                  To aid use of the menu, add a line of code to the keyboard configuration file to enable Numlock in the terminal when the Pi first boots.
                  
                  Open the config file:
                  
                  sudo nano /etc/kbd/config
                  
                  Locate and uncomment the following entry by removing the # from the start of the line (or create the line if it is not present), then save the changes:
                  
                  LEDS=+num
                  
                  Please note that the Raspbian desktop will still default to switching Numlock off; whilst there is a utility available, numlockx, to address this, it causes (harmless) errors to be displayed in the console.  
                  

                  This is an extract from this tutorial https://retroresolution.com/2016/04/19/multipurpose-raspberry-pi-part-2-adding-a-menu-to-access-retropie-kodi-and-the-raspbian-desktop/#li_numlock_on

                  EDIT* So... like everybody above the recent post said, then.

                  1 Reply Last reply Reply Quote 0
                  • C
                    challenger2010
                    last edited by

                    The etc/kbd/config is empty with Strech.

                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @challenger2010
                      last edited by

                      @challenger2010 Well, yes, that folder is no longer present. Use the setleds command to toggle the Num/Caps/ScrollLock on/off, which you can add to the your ~/.bashrc.

                      jonnykeshJ 2 Replies Last reply Reply Quote 0
                      • jonnykeshJ
                        jonnykesh @mitu
                        last edited by

                        @mitu I'm out of date. What's new?
                        I've never personally used it but it shows how out of touch I am.
                        Yes, it is gone.

                        1 Reply Last reply Reply Quote 0
                        • jonnykeshJ
                          jonnykesh @mitu
                          last edited by

                          @mitu

                          that folder

                          From now on I'm just going to say directory.
                          There is no such thing as a "folder" in Linux.
                          It might look like one but it's not.

                          1 Reply Last reply Reply Quote 1
                          • C
                            challenger2010
                            last edited by

                            Sooo....this didn’t work for Stretch :(. If anyone knows how, please help me out. When I am in any of the Retropie menu screens, pushing numlock on the keyboard doesn’t work either.

                            Thanks :)

                            mituM 1 Reply Last reply Reply Quote 0
                            • mituM
                              mitu Global Moderator @challenger2010
                              last edited by

                              @challenger2010 As I said, earlier, use the setleds to toggle the numlock. Add the lines below to /etc/rc.local:

                              INITTY=/dev/tty[1-8]
                              for tty in $INITTY; do
                                  setleds -D +num < $tty
                              done
                              
                              1 Reply Last reply Reply Quote 0
                              • C
                                challenger2010
                                last edited by

                                Thanks, that worked...but not for the emulator I am using. lr-o2em will not start a game with keypad numbers, only keyboard numbers. Strange, I hit F4 and tried the keypad and yes it produces numbers now. No clue why this is happening.

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post

                                Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.