Author Topic: Insert curly brackets as in Linux (AltGr+8 and AltGr+9)  (Read 11745 times)

Offline pozzugno

  • Multiple posting newcomer
  • *
  • Posts: 39
Insert curly brackets as in Linux (AltGr+8 and AltGr+9)
« on: October 19, 2012, 09:35:32 am »
I have an Italian keyboard, without curly brackets. In Linux I can insert them with AltGr+8 and AltGr+9, in Windows I can insert them with Alt+123 and Alt+125.

Can I configure Code::Blocks editor to mimic the Linux way? It seems Keyboard Shortcuts plugin can link the shortcut only to a menu functionality.

Offline Radek

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: Insert curly brackets as in Linux (AltGr+8 and AltGr+9)
« Reply #1 on: October 19, 2012, 12:06:14 pm »
This is not a problem of Code Blocks but a problem of your keyboard driver. It seems to be rather poor if it does not allow you to produce rather frequent characters. Possible solutions:

(1) Get a better keyboard driver.
(2) Use keyboard switching (the most common solution) between Italian and US (or UK) keyboards. When you are programming, you need a "US" character set.

Code Blocks are printing what they get from the driver. They do not contain a keyboard remapper.

Offline pozzugno

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: Insert curly brackets as in Linux (AltGr+8 and AltGr+9)
« Reply #2 on: October 19, 2012, 02:06:02 pm »
This is not a problem of Code Blocks but a problem of your keyboard driver. It seems to be rather poor if it does not allow you to produce rather frequent characters.
I know very well it isn't a "problem" of Code::Blocks, I was finding a workaround in Code::Blocks.
The keyboard driver is not poor: all italian keyboards haven't "physical" curly brackets keys and the operating system invents a different way to insert these special characters. As I said, Linux uses AltGr+7 and AltGr+0, Windows uses ASCII codes (Alt+<ASCII code>).

Anyway I think it should be very simple for a program to remap a key into a different character, unfortunately Code::Blocks hasn't this remapping function.

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: Insert curly brackets as in Linux (AltGr+8 and AltGr+9)
« Reply #3 on: October 19, 2012, 02:30:54 pm »
whats about "shift + alt gr + è" and "shift + alt gr + +" , the same as square brackets but with shift?

Martin

Offline jarod42

  • Multiple posting newcomer
  • *
  • Posts: 87
Re: Insert curly brackets as in Linux (AltGr+8 and AltGr+9)
« Reply #4 on: October 19, 2012, 02:37:50 pm »
Just tested on Windows with CB 10.5
and it works with both layout Italian and Italian (142)
Alt Gr + shift + 'è' for the italian layout (http://en.wikipedia.org/wiki/Keyboard_layout#Italian)

And Alt Gr + Number for Italian 142

Offline Radek

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: Insert curly brackets as in Linux (AltGr+8 and AltGr+9)
« Reply #5 on: October 19, 2012, 04:12:07 pm »
Even in winblows, AltGr 7 and AltGr 0 should work. Keyboard layouts 141 and 142 are standartised and both of them have '{' and '}' at these positions. If they haven't on your comp then it is a problem of the keyboard driver. Also try Shift AltGr é and Shift AltGr +, this is a Linux keyboard. The simplest solution should be the keyboard switcher. It is (it should be) a part of the operating system, even in winblows, and it should be already installed but not activated.

Select a keyboard switch key (for example, Ctrl-Shift) and install US keyboard along with the Italian one. When you are going to program, switch to US keyboard and you will have the brackets at Shift é and Shift +. When you have finished programming, switch to the Italian keyboard. You can switch the keyboard even during entering a text so that you can comment in Italian if you want.