The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Guide: CUA standard for copy, cut, paste shortcuts on fanky asus keyboard (Windows/Linux) + more

    Discussion in 'Asus' started by premudriy, Jun 15, 2010.

  1. premudriy

    premudriy Notebook Consultant

    Reputations:
    31
    Messages:
    167
    Likes Received:
    0
    Trophy Points:
    30
    Hello everyone,

    this guide is intended for those of us programmers who got accustomed to reaping the benefits of CUA standard for copy-cut-paste shortcuts and want to do the same on Asus laptop keyboards.

    This guide is for Windows and for Linux as well. For Linux we will also fix the behavior of the backslash-pipe key (\ and |).

    Introduction:

    Common User Access (CUA) standard uses another set of shortcuts for copy, cut, paste commands as following:

    Copy: Ctrl + Insert
    Cut: Shift + Del
    Paste: Shift + Insert.

    Why is this beneficial? If you are trying to copy output from any terminal then pressing Ctrl +C (more average user-known command) is not going to work obviously because Ctrl+C is "break execution" command in many terminals.

    Imagine you are doing a debug run on your lengthy program for half an hour and copying some debug info from terminal. Suddenly you hit Ctrl+C in an attempt to copy just to realize that you just killed the execution and have to start all over again. Sounds familiar? Maybe you even suffered that already and resorted to using mouse to copy paste every time? What a waste of time.

    This is were CUA standard comes into play. It is essential for programmers working in terminal based editors and such.

    The funky Asus laptop keyboard:

    When I bought my G51 I was disappointed by the placement of the Insert key on this laptop. Many other recent Asus laptops have the same type of keyboard. The problem is that Insert is merged with Delete key and requires the pressing of the Fn key, which is located on the left. lol. Forget about doing Ctrl+Fn+Insert with one hand.

    The keyboard itself is very nice, but the placement of the Insert key kills it. Now, someone might say something like "Well, this is a gaming keyboard and not for developers". I would say then "lol. What true programmer does not play games?" After all, for those of us developing 3D games good computer performance is a must.

    So, my goal was to get CUA functionality back on this laptop. After googling for days I could only find small bits and pieces about key remapping, but no complete guide and I thought that I should make this guide for everyone else.

    The Guide

    The idea behind getting CUA shorcuts is as following: NumLock is used less often then other keys (if at all), but it is placed perfectly for the new location of the Insert key. The Delete key is also located nearby, so making NumLock a new Insert will be perfect for CUA shortcuts overall.

    Now, some might still need NumLock and we will remap this key to the old Insert key. This way NumLock can still be triggered by pressing Fn+Del/Insert key.

    So, basically we need to swap the Insert and the NumLock keys.

    Therefore we will end up with the following shortcuts after remapping:

    Ctrl + NumLock => Copy
    Ctrl + Delete => Cut
    Shift + NumLock => Paste

    and Fn + Del => the NumLock modifier


    Making it happen for Windows

    To accomplish this in Windows we need a program called SharpKeys written by RandyRants. Get this program from here: RandyRants: SharpKeys

    Then do the following:
    1. Launch the SharpKeys.
    2. Click on Add and then select "Special: Insert" in the left menu and "Special: Num Lock" in the right menu and click Ok.
    3. Click on Add again, but now select "Special: Num Lock" in the left menu and "Special: Insert" in the right menu and click Ok.
    4. In the main program windows click on "Write to Registry", then "Close".
    5. Log out and log back in to Windows.


    Making it happen for Linux

    There is another problem with this keyboard in Linux. The backslah and bar (or pipe) keys (\ and |) are for some reason produce < and > symbols, which sucks. We will take care of this as well in one shot.

    For Linux we will use a built-in functionality, namely the xmodmap.

    So, here's what has to be done:
    1. In your home directory create the file called ".Xmodmap" (the first character is dot ".")
    2. Put the following into the ".Xmodmap" file (or add this if you already remapped some other keys):

    Code:
    keycode 94 = backslash bar
    keycode 77 = Insert
    keycode 118 = Num_Lock
    clear mod2
    add mod2 = Num_Lock
    
    3. Save, log out and log back in.
    4. If xmodmap configuration window will show on next login on your Linux distro, then:
    i) choose the ".Xmodmap" file on the right side and click "Load" buttonton
    ii) put a check mark at the bottom, so this dialog won't show up next time.​


    That's it, we are done. Now your programming sessions will become more efficient (not doing 100+ mouse clicks to copy paste from terminal) and much less annoying/aggravating (not killing a lengthy debug run by pressing Ctrl+C by mistake).

    Enjoy!
     
  2. Kalim

    Kalim Ceiling Cat Is Watching U

    Reputations:
    482
    Messages:
    1,021
    Likes Received:
    0
    Trophy Points:
    55
    I thought the G51 had a number pad? Wait.... Googling.... Yes, it has a number pad.

    I'm not understanding the need to modify the keyboard mapping when there are two sets of insert and delete keys. One set, like you said, is combined and requires the Fn key to toggle. The other set are independent keys and work with the Num lock off and can be used with one hand. It would seem to me that the second set is just as easy as their traditional placement on a full size keyboard.
     
  3. premudriy

    premudriy Notebook Consultant

    Reputations:
    31
    Messages:
    167
    Likes Received:
    0
    Trophy Points:
    30
    I use the numpad often as well, so I would have to keep turning NumLock on and off frequently to use both shortcuts and numpad. By modifying the keys we end up with possibility of enjoying two cakes at once.