How to create a unicode combination of keys by pressing one key (Simplify unicode adding)
I am trying to simplify the way I add Unicode characters. At least to make them easier as in Windows for ASCII characters for new comers.
Right now for example to add the letter Ñ I have to press CTRL+SHIFT+U and then type the unicode character 00D1 and then press space.
What I want is to combine the CTRL+SHIFT+U part into one press. For example, pressing a special key I do not use would trigger the CTRL+SHIFT+U behaviour and I would just need to add the code part.
How can I combine this 3 keys (CTRL, SHIFT, U) into one, including the property of having to press them at the same time.
A program like xmacro
may be of help:
xmacrorec can be used to record mouse and keyboard events on any X11 display.
.
xmacroplay can be used to playback recorded events or send any other
mouse/keyboard events you choose. It is very handy for scripting an
X display - for example controlling a presentation in mgp or ultrapoint
from a script, network connection...
.
xmacroplay-keys is a script to help use the above.
If I'm understanding this correctly, you'd first define a macro for ctrl+shift+u (note it's shift rather than control, your original post has a small mistake in this respect), then use use Ubuntu's keyboard shortcuts to execute xmacroplay to "play back" your macro.
I have to admit I haven't really tried this myself, as I think a much better solution would be to ask yourself why your users need to enter cryptic Unicode characters by hand, instead of having a keyboard layout that allows them to do so natively. You mention the specific case of Ñ, which can be very easily entered in spanish or latin american keyboard layouts.
Moreover, if you have a US keyboard, you can use the "English (International AltGr dead keys)" layout to enter special characters for many languages, mainly by using AltGr (e.g. AltGr+n = ñ, AltGr+vowel = accents (áéíóú) and so on) .
I suggest you configure this keyboard layout and then click on the small keyboard icon in the Keyboard Layouts control panel to see all the key mappings; chances are, most special characters you are likely to need can be entered with this layout and it will be easier to remember than Unicode codes and three-key combinations, since the mappings are generally quite intuitive (AltGr + ? = ¿, for instance).
I also disagree with the idea that entering ASCII characters in Windows is easier for newcomers. The key is just as arbitrary (Alt + NumPad?), the codes are just as arbitrary to memorize (and it breaks my heart to see the little ASCII code charts pasted on people's desks), and this "crutch" also stems from the same underlying problem, which is a misconfigured keyboard layout.
I do apologize for ranting, and I hope my answer proves useful; if you are unable for some reason to set a keyboard layout as I suggest, maybe you could update your question with more details in this regard so either I or someone else can provide a more useful solution.