The basic Italian keyboard layout as shipped with Windows 7 has no way of typing the backtick (`) or the tilde (~). I checked this using Microsoft Keyboard Layout Creator (MSKLC), with that layout loaded into it. I presume that this layout is more or less standard in Italy, though of course Microsoft might have its own oddities here.
However, in Windows 7, there is a somewhat different layout called “Italian (142)”. In it, the backtick can be typed using AltGr + and the tilde using AltGr §. Here “+” and “§” refer to the keys labeled so in the picture in the question, i.e. two keys to the right of “P” and three keys to the right of “L”. I suppose this “Italian (142)” might be some kind of “Italian programmer’s keyboard”, or just a variant keyboard, possibly reflecting different physical keyboards.
If you are using Windows (as I guess because you mentioned “Control Panel”), consider downloading MSKLC and using it to create a modified Italian keyboard layout that suits your needs, and use it as the normal layout, with no need for switching between layouts. You could e.g. make AltGr ' produce the backtick and AltGr ^ produce the tilde; these should be relatively easy to remember due to similarity of characters.
As to the “why” question (why basic Italian layout lacks those characters), I would say that keyboards are primarily designed for typing texts in natural languages, and Italian has little use for those characters. The layout has keys for à, è, ì, ò, ù, so there is no need for a backtick key acting as a dead key (diacritic key) for typing vowel + grave accent combinations, as in many other European keyboards. And while other Romance languages have letters with a tilde, like ã and ñ, Italian does not.
Best Answer
First find event handler of your second keyboard. Run
Find your second keyboard device in the output and note number of event handler. For example:
"H: Handlers=sysrq kbd event2" tells us that device we want to monitor is /dev/input/event2. Now we need to capture pressed keys. A useful tool is
actkbd
- http://users.softlab.ece.ntua.gr/~thkala/projects/actkbd/ After downloading it and installing you can get keyboard codes with:Pass event device you got before to
-d
option. Tap keys you want to use, note their numbers and turn offactkbd
with Crtl+C shortcut.To bind commands to shorcturs put into actkbd configuration file,
/etc/actkbd.conf
, lines with following format:key-numbers:::command
and runactkbd
daemon again same way as before. For example to rungedit
after tapping a key put this line:Inserting Unicode characters is more tricky. I don't know if there is a way to insert those directly but I can propose a simple workaround. You can use
xclip
orxsel
command to put any string into clipboard, and then paste it into any application you want using middle mouse button. Example configuration line using q button key: