Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a laptop without a numeric keypad on which I'm running Ubuntu 12.04, and I very much enjoy playing roguelike games. Such games tend to require a numpad for movement, targeting, &c., as one is able to operate in the eight cardinal directions. To get around the limitation of not having a numpad, I would like to be able to bind a key combination, for example Shift + Left Arrow to another key, in this case 1; unfortunately, my research so far has only turned up how to bind a key combination to a command. I'm sure there's something blaringly obvious that I'm missing, but as for what it is ... Any help would be greatly appreciated!

share|improve this question
    
If you are playing at home, you can just plug a normal keyboard to your laptop. I bet that's the easiest way, no fuss with software, Plug-n-Play! –  Yrogirg May 26 '12 at 7:38

3 Answers 3

up vote 10 down vote accepted
+150

if you want to do that on windows there is very useful scripting language AutoHotKey which can do alot with scripting interface.

A perfect alternative to AutoHotKey is AutoKey. Very useful weather you want to remap keys or assign abbreviation(adr) and it will write your full address!!

AutoKey is a desktop automation utility for Linux and X11. It allows you to manage collection of scripts and phrases, and assign abbreviations and hotkeys to these. This allows you to execute a script or insert text on demand in whatever program you are using.

Latest version is v0.90.

  • Where to get this? it is in the ubuntu's repository!

Open software center > search for autokey > install AutoKey(GTK)

  • How to use this?

Open AutoKey.

Press Ctrl+N or from File>Create..>New Phrase. Rename with whatever you like. enter image description here enter image description here

Enter keys In right panel(remove text Enter phrase contents) you want to get typed (in your case Shift + Left Arrow so will type <shift>+<left> )when you hit some key. full info for Special Keys like shift,arrow, etc. are described here. enter image description here

Then in bottom-right corner there is three Set buttons to set for Abbreviation or Hotkey or Window Filter or all of them.

Click Set for Hotkey. You will be prompted to give HotKeys. If you want to make it run with single key(in your case 1) Don't click on any other button than Press to Set. enter image description here

Click Press to Set and hit a key you want to assign(in your case 1).

Click OK.

Click Save in bottom-right corner. enter image description here Now try by hitting 1 wherever you want.

You need to keep AutoKey running or you can add in startup list for command autokey-gtk

Amazing turorial is here :))

here is some Sample Scripts If you'd like to do some thing more.

share|improve this answer

This was pretty much answered in other questions like this one, but the short version is you should be able to do this level of remapping with xmodmap. I have done this sort of thing for mapping key combinations to the multimedia key actions, for example.

share|improve this answer

Thank your share, I mapping the Ctrl + h, j, k, l to be , , , , now I like my HHKB better.

If you have HHKB, you can also setting under:

Shift + Esc = ~

Ctrl + 0 = Home

Ctrl + 4 = End

Ctrl + b = PgUp

Ctrl + f = PgDn

by the way, I note it at my blog ---- 凍仁的筆記:HHKB Pro 2.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.