Author Topic: Alt-Gr  (Read 13190 times)

cb831

  • Community Member
  • Posts: 16
  • Hero Points: 0
Alt-Gr
« on: October 18, 2007, 09:53:12 AM »
Hi

On European keyboards the right [Alt] key is called [Alt-Gr] and is used to get to characters like [] {} @£$ ~€.
This works fine in SlickEdit (v11).

However in most other programs I know of the combination of left [Ctrl] and left [Alt] has the same effect as pressing [Alt-Gr] meaning that is is much easier to get to heavily used keys like [] and {} when programming.
This does not work in SLickEdit (v11).

Is there anyway I can set up this binding and will Slickedit support it by default in the future ?

Thanks
Claus

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: Alt-Gr
« Reply #1 on: October 23, 2007, 07:48:56 PM »
I'm assuming you have a German keyboard layout.  Is this under Windows or Unix? Are you saying that RightAlt+0 and LeftAlt+0 produce a character like }. 

Clark

cb831

  • Community Member
  • Posts: 16
  • Hero Points: 0
Re: Alt-Gr
« Reply #2 on: October 23, 2007, 09:28:21 PM »
Actual it is a Danish keyboard which you can see here http://en.wikipedia.org/wiki/Keyboard_layout#Danish but many other keyboard layouts have similar issues.
Apparently no programmers were in the commitee that decided on these keyboard  layouts ;)

The blue symbols (in the link) are produced by using Right Alt aka Alt-Gr only. Using Left Alt will produce other codes like on US-keyboard: Left Alt-9 is Alt-9 and not }.
This all functions ok in SlickEdit.

However when I press Left Alt and Left Ctrl simultaneously it has the same effect as pressing Alt-Gr alone in Windows eg. {[]} was produced in this window by pressing LeftCtrl and LeftAlt while keying 7890 !

This does not work in SlickEdit and that is a pitty because it is much easier to key in parentheses using the latter shift keys (using left hand) than using Alt-Gr.

Thanks
Claus
« Last Edit: October 23, 2007, 09:37:43 PM by cb831 »

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Alt-Gr
« Reply #3 on: October 23, 2007, 10:52:35 PM »
BTW: This could solve a lot of these issues (and much more): http://www.autohotkey.com/
Can't live without it ...
HS2

cb831

  • Community Member
  • Posts: 16
  • Hero Points: 0
Re: Alt-Gr
« Reply #4 on: October 24, 2007, 01:28:24 AM »
More BTW:

I think that also key bindings like Ctrl+] (match parantheses) Ctrl+= (diff) etc does not work for me because of some linking to the US keyboard layout.

It is like SlickEdit has its own partial keyboard driver that does not localize correctly with the underlying real keyboard...?

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Alt-Gr
« Reply #5 on: October 24, 2007, 01:40:59 AM »
Don't care about the default (US) bindings. Just rebind the affected commands to the keys you want.
@see 'Tools>Options>Key bindings'
HS2

cb831

  • Community Member
  • Posts: 16
  • Hero Points: 0
Re: Alt-Gr
« Reply #6 on: October 24, 2007, 09:53:26 AM »
I tried that and the binding dialog accepts Ctrl+Alt+0 for } but how do I keyin the } ?
Do I have to create a command to appear in the Command column for each char I want to bind ?
If yes - how should that command look like to work all modes ?

To me it looks like SlickEdit is blocking/overriding some infomation coming from the OS as it works everywhere else...

It has something to do with which layer is interpreting the shift keys I guess... Now Alt-Gr (right alt) is interpreted in the OS but other shifts are interpreted in Slickedit: In keybind I see Alt+0 when i press left Alt, and } when I press right Alt meaning that whatever OS API call Slickedit uses to get the keys the call interprets the Alt-Gr but not the other shift keys...

BTW how do you remove bindings in the dialog - unbind is greyed out all the time?
« Last Edit: October 24, 2007, 09:56:16 AM by cb831 »

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Alt-Gr
« Reply #7 on: October 24, 2007, 11:04:31 AM »
The binding 'Ctrl-Alt-0' should be ok. The command to bind is 'keyin-brace'. There are a few 'hot' chars that are not used directly. Instead they are wrapped by commands managing some language dep. enhancements (smart indent, matching brace hiliting, etc.).
I also don't know at which level the input devices are handled/hooked.
This is anyway handled in various ways by different apps. As already mentioned I'm using 'Autohotkey' to resolve this kind of issues. This tool hooks the input devices at a low level which would allow to remap some keys or combinations also for SlickEdit.
BTW: Which SE version dou you use ? v12.0.x comes with a greatly improved keybinding dialog with a 'Remove' button.
HS2

cb831

  • Community Member
  • Posts: 16
  • Hero Points: 0
Re: Alt-Gr
« Reply #8 on: October 24, 2007, 11:45:46 AM »
I'm using v11 and I'm reluctant to upgrade until 2008 as upgrade fee is the same whether you step one or two major upgrades.
Offcourse I can use your suggestion but I would expect SlickEdit to get this right - I mean it is standard functionallity in other programs.

v11 does not have that keyin command
« Last Edit: October 24, 2007, 11:50:28 AM by cb831 »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: Alt-Gr
« Reply #9 on: October 24, 2007, 01:55:21 PM »
Hmm..I wasn't aware that LeftCtrl+RightAlt was another way to get these characters on Windows.  I will check into this as well as the other issues you mentioned.  Hopefully, I can make this work without breaking something.

cb831

  • Community Member
  • Posts: 16
  • Hero Points: 0
Re: Alt-Gr
« Reply #10 on: October 24, 2007, 03:05:18 PM »

Quote
I wasn't aware that LeftCtrl+RightAlt

...pressing LeftCtrl+LeftAlt has same effect as pressing Right-Alt alone (Right-Alt is also called Alt-Gr)


Thanks :)

Please keep me posted...
« Last Edit: October 24, 2007, 03:12:33 PM by cb831 »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: Alt-Gr
« Reply #11 on: October 24, 2007, 07:51:37 PM »
I seem to have this working.  It will have to wait until V13 since this new code will require a lot of beta testing. 

Ctrl+= and Ctrl+] still won't work.  You'll need to bind these commands to different keys. Use Ctrl+` and Ctrl+" to make them work in the same key position.  This is not a bug.  As an extra verification, I checked out Visual Studio and it processes these keys the same way we do.

cb831

  • Community Member
  • Posts: 16
  • Hero Points: 0
Re: Alt-Gr
« Reply #12 on: October 24, 2007, 09:32:09 PM »
Great!

Thanks
Claus