Tutorial: Virtual Numpad on laptops that don't have one built-in

Hi all! After getting so much good help from the people on Arch forums, I thought it was time to give back.
You remember how on older laptops, you would hit numLock and a portion of your keyboard would become a numpad? (specifically, the 789uiojklm keys) Well, recently I got a new Lenovo Y40 and I never knew how much I loved having a numpad until I found that my new laptop didn't have one. Unfortunately, the Y40 does not come with this feature out of the box, but luckily, Arch Linux is on our side. I am going to tell you how I set up my own virtual numpad using tools that come built-in with X.
Before we start, I should point out that everything I learned in order to do this was found here:
https://wiki.archlinux.org/index.php/X_ … _Modifiers
From the warnings section:
It is possible (and, in fact, easy) to end up disabling some keys on your keyboard for the current X session while working with XKB. This includes modifiers, cursor arrows and Enter key, as well as C-A-Backspace and C-A-Fx combinations. Make sure you have some way to terminate the session without using your keyboard.
While it is rare, changing XKB configuration can sometimes hang or crash X server. Make sure you can handle it. Having some way to killall X or reboot the host remotely may be a good idea.
Stop xxkb, or any other layout switching applications. xxkb actively changes XKB state. Debugging both at the same time is not a good idea.
And finally, be warned: it is very easy to get used to custom layout.
If you want to learn more, that wiki article is the best available xkbcomp documentation for people who aren't X developers (lit. me). And with that, let's get started!
Getting Set Up + xkb Background Info
The first thing we will do is run the command
xkbcomp $DISPLAY outfile.xkb
This will spit out the code that represents the current keyboard layout. Our end goal will be to code in what we need into this file, and upload it back to the X server. I recommend editing this file in an editor with C/C++-style syntax highlighting, since it might prevent you from making syntactical errors.
There are many sections to the .xkb file, but we will only concern ourselves with xkb_types, xkb_compatibility, and xkb_symbols.
xkb_types lets you define types for each of the keys on your keyboard. For example, if you use Canadian Multilingual Standard (like I do) most of your keys are given the type "EIGHT_LEVEL_SEMIALPHABETIC". When a "special key" like ctrl, alt, caps lock, etc is pressed, in xkb_types, we map these modifiers to "LevelN", and different combinations will mean different things for different types. For 8-level-semialphabetic, no special keys pressed is "Level1", Shift is "Level2", etc.
If we jump forward to xkb_symbols, and look at the keys, we see that each key is assigned a type, and an array. The first element in the array is what symbol the key represents for Level1, the second is the symbol for Level2, etc.
Finally, xkb_compatibility allows us to set which keys turn on which modifiers (as well as other things).
So with that, let's get started
Editing the layout
We will begin by editing the xkb_types section. First, we will pick an unused type from xkb_types (you could create your own, but it will be more work). It doesn't matter which type you picked, so long as none of your keys use it. Take down the name. Now delete the unused type, and in its place, copy paste the type that your keys used already. Finally, change the name of the copy to the type you deleted. For example, I deleted EIGHT_LEVEL_ALPHABETIC, copied and pasted EIGHT_LEVEL_SEMIALPHABETIC, and changed the name on the copy back to EIGHT_LEVEL_ALPHABETIC. Next, change the modifiers variable to accept NumLock. This is done by concatenating '+NumLock' before the semicolon. Lastly, we will bind it to a level. You can create a level, or simply pick one that you were not using, and add the line (where N is the desired Level)
map[NumLock]= LevelN;
Next, we will turn our attention to xkb_compatibility. Simply copy paste this code into the xkb_compatibility section, taking care to replace Scroll_Lock with the key you wish to use to toggle the numpad:
interpret Scroll_Lock {
virtualModifier= NumLock;
action= LockMods(modifiers=NumLock);
Now comes the more tedious part of editing the layout. For every key that is part of your virtual numpad, change the type to the copy we made earlier. (In my example, I would change EIGHT_LEVEL_SEMIALPHABETIC to EIGHT_LEVEL_ALPHABETIC). Finally, locate the Nth element in the array (indexing from 1) where N is the level you bound the NumLock modifier to in xkb_types. Replace this with the desired nunmpad key. For your convenience, here is a list of the numpad keys I used:
KP_0
KP_1
KP_2
KP_9
KP_Add
KP_Subtract
KP_Divide
KP_Multiply
KP_Decimal
For example, here is the entry for my 'u' key (note the KP_4):
key <AD07> {
type= "EIGHT_LEVEL_ALPHABETIC",
symbols[Group1]= [ u, U, NoSymbol, NoSymbol, downarrow, uparrow, NoSymbol, KP_4 ]
If you are wondering what to do if you want to bind numpad keys to your Fx keys, I added a note at the end of the post.
Uploading the layout to the X Server
And now the moment of truth. First, run
xkbcomp myNewLayout.xkb
This will NOT upload to the X Server yet; it will only compile the file and check its syntax. One cryptic error I got was because I used C-style /*block quotes*/. xkbcomp doesn't like these, but it doesn't mind //this kind of comment. If we have no errors, we can now upload with
xkbcomp myNewLayout.xkb $DISPLAY
Well, go ahead and try it out, there will almost surely be some really neat tweaks you can do.
Extra Stuff/Notes
When you hit Scroll_Lock (or whichever key it was you chose) it locks the new type we made to LevelN. This is why we went to the trouble of making a new type, so that the rest of the keyboard would not be locked in LevelN mode. For example, on my setup, I first tried this without creating a new type, and found that the rest of my keyboard was not behaving normally, since it was also bound to Level8 (my desired numpad level). So, I created a new type for my numpad keys so that the rest of the keyboard would still act in its usual manner even when I had the numpad on.
If you're wondering, I bound KP_Multiply and KP_Divide to my F8 and F9 keys. However, I didn't need to change the type, since the level I chose (Level4) also caused the Fx keys to act normally (except if I rebound them). That is, before I changed anything, all the Fx had the corresponding Fx key bound to Level4. I simply changed the Level4 keybinds for F8 and F9. This meant that when I activated the virtual numpad, F8 and F9 were KP_multiply and KP_Divide, and the rest of the function keys were what they were usually.
Hopefully, this tutorial won't only help you to make a virtual numpad, but maybe help some other newbies like me to further customize their system. And the Arch Wiki author is right, you really do get used to the new layout and it becomes frustrating to use other computers!
Happy trails.
- Marco
Last edited by mahkoe (2014-11-02 12:17:49)

Ikester wrote:
Re: My laptops that don't have a linksys card, but built in wireless can stay connected to WEP
OK since your security is set to WPA why do you want to go to WEP? DS? If everything is configured correctly you should not have to change anything. If you are connecting another device and forgot what your WPA setting were just go into the router and take a look see.
1. I set up everything, its all fine and ok
2. The DS can't connect to WPA, only WEP or Open
3. I know what my WPA settings are and the codes to both settings

Similar Messages

  • My laptops that don't have a linksys card, but built in wireless can stay connected to WEP

    I have a linksys WRT54GS Version 5, firmware 1.51.0 (updating after this)

    Ikester wrote:
    Re: My laptops that don't have a linksys card, but built in wireless can stay connected to WEP
    OK since your security is set to WPA why do you want to go to WEP? DS? If everything is configured correctly you should not have to change anything. If you are connecting another device and forgot what your WPA setting were just go into the router and take a look see.
    1. I set up everything, its all fine and ok
    2. The DS can't connect to WPA, only WEP or Open
    3. I know what my WPA settings are and the codes to both settings

  • Submitting photos for artists that don't have one

    I love Spotify for including not only the commercially succesful music but recordings of ALL type.
    However, many times some of the unfamous artists don't have photos or bios. It would be great if users could submit these and if appropriate to update the artists' information. Perhaps it would be best if the photos and bios reach the representatives of the artists.
    Let me know what you think!

    Updated: 2015-07-16Hello!
    Your idea has been submitted a while ago but unfortunately hasn't gathered enough kudos (25 per year). In order to keep an overview of the active ideas in this forum, we will close this idea for now. However this does not mean that your idea has been declined by Spotify.
    If you still feel strongly about your request, we encourage you to post your idea in a little different form again! Maybe now is the right time to receive the support of our community for your suggestion! ;)
    Do you have any further questions on how the idea exchange is managed? Just click here!

  • I purchased a ipad app (virtual history ROMA) but I don't have a iPad. What i like to do is install it on my grandson's iPad. Can I do that?

    I purchased a ipad app (virtual history ROMA) but I don't have a iPad. What i like to do is install it on my grandson's iPad. Can I do that?
    https://getsupport.apple.com/ServiceOptionAction.action

    Of course you can do that!
    You just have to enter your Apple ID on your grandson's iPad and then conect it to your computer.
    You'll see on your iTunes library that there's a little label on the top left corner of iTunes that indicates you all you have on your library. Well, if you click on that, you'll see there's an option to see Apps. You click on that (remember, you must have your grandson's iPad connected) and you'll be able to see all the apps you have downloaded with your Apple ID.
    Then you have to go to the top right of iTunes and you'll find a button that shows the iPad connected. Click on that and it'll show up your iPad summary. On top of that page, you'll see some options. One of them says "Apps". You click on that one and there should appear the apps you have downloaded. Choose the App you want to install and simply click "Install".
    After that you can eject your iPad and enjoy your new App!
    Hope it helped!!

  • How do I get rid of the Microsoft Setup Assistant loop? I migrated my software/documents from another laptop so don't have the disk to reinstall. Please help! Can't open any Microsoft Office software, like Word, and stuck in a loop?

    I migrated my software/documents from another laptop so don't have the disk to reinstall. Please help! Can't open any Microsoft Office software, like Word (for 2008), and stuck in a loop?
    Whenever I select Word Microsoft Setup Assistant appears, asks for feedback, then after selecting okay (both on saying yes or no to feedback) goes on to a registration page. When I click on this it says I've already registered so I just click okay, and then move on to a update page. After this, if I click on Word, the process repeats itself.
    As I said, I don't have the disk to reinstall, and can't find the Office Settings to delete as many pages have suggested I should try. Safe Boot restarting also hasn't worked... Really stuck and need Word very soon for work.
    If you can help, that would be great, and feel free to ask any questions about the situation as I'm not an expert here.
    Cheers,
    Jack

    First, export your contact from iCloud.com and save them on your computer in a safe spot some where (like you desktop).  Use this to help you do this: http://support.apple.com/kb/PH3606
    Next, on both of your devices, go to Settings > iCloud and turn on contacts and select Merge. Then turn off contacts and select 'Delete form my [device]' when prompted.
    Now go back to iCloud.com and select a contact (yes they will all be messed up again) and select Command+A on a Mac or Control+A on a PC to select all of the contacts.  Tap the delete key on your keyboard (or right click /control click a contact and select delete).
    You iPhone, iPad and iCloud.com should not be empty for contacts.
    Go back to Settings > iCloud on both devices and turn on contacts again (you should not see merge this time).
    Next, go back to iCloud.com and import your contacts (those exported .vcards).  You can either drag and drop them into the empty contacts list in your web browser, or you can use the gear icon to import.
    You cleaned up contacts should import correctly into iCloud.com and sync to both of your devices.
    Good luck.

  • I have a late 2011 model MacBook Pro running Mountain Lion.  I love the AirPlay mirroring feature with Apple TV...BUT, how do I mirror with TVs that don't have Apple TV?  I used to run a cable from my mini display port to the HDMI input of a TV.

    I have a late 2011 model MacBook Pro running Mountain Lion.  I love the AirPlay mirroring feature with Apple TV...BUT, how do I mirror with TVs that don't have Apple TV?  I used to run a cable from my mini display port to the HDMI input of a TV.  This feature seems to be lost in the Mountain Lion upgrade.  Did Apple feel that once Mountain Lion came out that EVERYONE would have Apple TV?  There are no settings in System Preferences/Display like there used to be...only for AirPlay Mirroring.

    Running a cable to the HDMI port is still supported. (and still works on mine).
    If the Arrangement tab in System Preferences > Displays isn't present then it doesn't recognize the physical connection.  Double check all cables.  If that doesn't work try a PRAM reset:
    http://support.apple.com/kb/ht1379

  • I've downloaded some free games for my iphone4 but they are using my internet because they have ads. does anyone know if there are any games that don't have these ads and don't require internet AT ALL?and if i disable my internet connexion, does it help?

    i've downloaded some free games for my iphone4 but they are using my internet because they have ads. does anyone know if there are any games that don't have these ads and don't require internet AT ALL?and if i disable my internet connexion, does it help?

    Thank you. I put it in airplane mode like you suggested, but it looks to me like all the applications and ads are still running. Anyway, I'm just gonna play when I'm really really bored and use them as less as possible. Thank you again for your quick answer.

  • TS1627 I Can no longer synch my iPhone and iPad to Outlook using iTunes on a Win 7 Pc.  I updated to iTunes 11.1.4.62 a few days ago.  Don't know if that caused my problem. I've reset the Synch History, deleted any Notes in Outlook that don't have a subje

    I Can no longer synch my iPhone and iPad to Outlook using iTunes on a Win 7 Pc.  I updated to iTunes 11.1.4.62 a few days ago.  Don't know if that caused my problem. I've reset the Synch History, deleted any Notes in Outlook that don't have a subject. Grateful for any help.

    You might have better luck in the iTunes for Windows community. I'll ask the hosts to relocate your post.
    iTunes for Windows

  • Purchased Acrobat 9 Pro and installed on previous laptop. Got a new laptop that doesn't have a CD/DVD drive. How do I install?

    How do I install a Acrobat 9 Pro on my new laptop that doesn't have a CD/DVD drive? I have the disk and serial #.

    Download Acrobat products | 9, 8
    Mylenium

  • I purchased photoshop 9 previously and I now have a new laptop that does not have a 'disk' tray. Where do I download this from to put on my new laptop? I went to the download section and there is no download for English

    I purchased photoshop 9 previously and I now have a new laptop that does not have a 'disk' tray. Where do I download this from to put on my new laptop? I went to the download section and there is no download for English

    I assume you mean Photoshop Elements 9.
    Download from: Download Photoshop Elements products | 9, 8, 7

  • PSE9/Win 7: Can I create a Smart Album of all images that Don't have a certain tag?

    Using PSE9 on Windows 7.
    I'd like to create a Smart Album that contains all of the images that don't have a particular tag.
    When I click on Create New Smart Album the dialog box allows me to select 'Keyword Tags'.
    But the next item is 'Include'. Then I can select that tags I want.
    I basically want the Include to be 'Exclude'.
    Any way to do something like that?

    Hi,
    You could try this.
    1) Show all photos
    2) Check the Keyword Tag that you are interested in
    3) Under Options Select Hide best match results & Show results that do not match (i.e. reverse the last two conditions).
    to read
    That should be showing you what you wanted to see
    4) Now use the top option Save Search Criteria As Smart Album and give it a name
    That seems to remember the reversed conditions as well as the tag.
    Good Luck,
    Brian

  • [svn:osmf:] 14871: Fixing anchoring 'right' and 'bottom' properties not being applied on items that don't have a width/ height and position set.

    Revision: 14871
    Revision: 14871
    Author:   [email protected]
    Date:     2010-03-19 01:05:54 -0700 (Fri, 19 Mar 2010)
    Log Message:
    Fixing anchoring 'right' and 'bottom' properties not being applied on items that don't have a width/height and position set.
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/layout/LayoutRenderer.as

    If you're just doing it in a back and forth or spiral fashion, you don't need to check whether a square's been filled in. You just go from a start point to an end point. Those points and the squares in between are determined by simple arithmetic.
    If you're doing it randomly, I wouldn't use the GUI elements themselves. I'd have, for example, and array of booleans that tells whether each square has been filled in.

  • Add-on to capture videos from internet that don't have a download link.

    Is there an add-on to capture videos from internet that don't have a download link. I am on a Mac.

    In general, you don't need drivers for camcorders on Macs, and the .exe file you downloaded is a Windows program, which won't run on a Mac unless you also have Windows installed.
    It would help a lot if you tell us the exact model camcorder you are using, and what application you want to use it with.
    Regarding iTunes, the latest version is iTunes 11.  You need to have OS X 10.6.8 or later to install iTunes 11.  Your profile says you have OS X 10.4.11, which is a much older version of OS X, so you won't be able to install iTunes 11.  (Here are the iTunes 11 specs.)

  • I have a 5s iphone and I am unable to talk and text to my friends that don't have an iphone. I used to be able to before the latest update. How do I fix this?

    I have a 5s iphone and I am unable to talk and text to my friends that don't have an iphone. I used to be able to before the latest update. How do I fix this?

    I figured out how to fix the microphone with texting!!  I powered off my iphone. I don't know what caused the microphone to stop working, but it works now!  Thanks for trying to help.

  • How do I install my photoshop elements to my new laptop that does not have a cd disk drive?

    How do I install my photoshop elements 12 to my new laptop that does not have a disk drive?

    download pse 12 trial and activate with your serial number, http://www.adobe.com/cfusion/tdrc/index.cfm?product=photoshop_elements

Maybe you are looking for