Keymapping Issues with alt + {letter}

Answered

I have an auto hotkey script that binds alt+i to the up arrow. Whenever I use intellij and try to navigate the caret upward with my binding it will only move the caret one position upward before it starts inserting the letter 'i' where ever the caret is located. In order to move the caret upward with my binding I have to physically press alt+i then physically release both buttons and repress them to move the caret upward again. This is incredibly annoying. Ideally I could hold down the alt key and press 'i' as many times as I want and still have the caret move upward.

Moving caret upward 1 position: alt+i

Moving caret upward 2 positions: alt+i , physically release both keys, alt+i

Any other text editor or IDE I have used allows for me to press and hold the alt key while pressing 'i' as much as needed to move the caret to the correct position.

 

I thought that maybe it was because it was an auto hotkey script. I remapped space+i to be the up arrow within Intellij but still have the same effect. Ideally it would function like the up arrow. I should be able to hold both alt+i down and the caret should continuously move upward. Anyone have any idea how to fix this bug?

1
21 comments

Does it work in other Java Swing applications like NetBeans or JEdit?

0
Avatar
Permanently deleted user

I just downloaded JEdit and checked. It works fine with these auto hotkey bindings.

0

Does it help if you run IDEA with Oracle Java? See https://intellij-support.jetbrains.com/hc/articles/206544879.

If not, please share your AutoHotkey binding configuration.

0
Avatar
Permanently deleted user

Here is my ahk file contents:

Capslock::Esc
Esc::Capslock
!i::SendInput,{UP}
!+i::SendInput,+{UP}
!j::SendInput,{LEFT}
!+j::SendInput,+{LEFT}
!l::SendInput,{RIGHT}
!+l::SendInput,+{Right}
!k::SendInput,{DOWN}
!+k::SendInput,+{DOWN}
!u::SendInput,{HOME}
!+u::SendInput,+{HOME}
!o::SendInput,{END}
!+o::SendInput,+{END}
!BS::SendInput,{Del}

0

Can't reproduce.

Windows 10, AHK 1.1.24.01, IDEA 2016.3, 64-bit Java 1.8.0_112 (from https://bintray.com/jetbrains/intellij-jdk/openjdk8-windows-x64#files/).

I can hold Alt+I and the caret moves up continuously.

0
Avatar
Permanently deleted user

I have IDEA Community Edition 2016.2.5, AHK 1.0.48.05, Windows 10

0

Try using the same versions of IDEA and AHK as I've mentioned and see if it helps.

0
Avatar
Permanently deleted user

Just installed IDEA 2016.3 and AHK 1.1.24.01.... no luck

0
Avatar
Permanently deleted user

I believe I already am using the 64-bit JDK

0

Please verify in Help | About that you are using 1.8.0_112 version from JetBrains (see the link to bintray above).

0
Avatar
Permanently deleted user

I have Java HotSpot 64bit as my JDK

 

IntelliJ IDEA 2016.3
Build #IC-163.7743.44, built on November 17, 2016
JRE: 1.8.0_111-b14 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

0

That is different one, but probably it's not related to Java version, but something else in your system. Anyway, we were not able to reproduce the problem, sorry.

0
Avatar
Permanently deleted user

Thanks for the help anyway. If I figure out the problem I will post the solution. 

0
Avatar
Permanently deleted user

I have the same issue. It seems that the problem is best described here https://www.reddit.com/r/AutoHotkey/comments/574tay/how_to_get_worked_key_combination_with_alt/

"when pressing Alt key in intellij once, it will press Alt key twice actually. (the second key is Left alt key)

below url is the capture from ahk key history and script info view about pressing RAlt key in intellij:

http://i.imgur.com/pbZGanC.png

In other applications like notepad is normal:

http://i.imgur.com/UdLsMss.png "

0
Avatar
Permanently deleted user

Example of my ahk configuration

<!u::SendInput {Up}
*<!n::SendInput {Left}
<!e::SendInput {Down}
<!o::SendInput {Right}
<!p::SendInput {End}
<!f::SendInput {Home}
<!b::SendInput {Delete}
<!l::SendInput {Backspace}

0
Avatar
Permanently deleted user

Oh, and I forgot to add, this happens only if for LAlt. So if I would reverse RAlt and LAlt in my configuration, it would work fine

Reversed configuration example

>!u::SendInput {Up}
*>!n::SendInput {Left}
>!e::SendInput {Down}
>!o::SendInput {Right}
>!p::SendInput {End}
>!f::SendInput {Home}
>!b::SendInput {Delete}
>!l::SendInput {Backspace}

0
Avatar
Permanently deleted user

Psykeonfarm - 

I actually just found a work around a few days ago. What I did was in the IntelliJ editor I added a few keybindings to the IDE itself (up -> alt+i, down -> alt+k, left -> alt+j, right -> alt+l) through the settings menu -> keymap. Once I had manually set the keybindings that I wanted in IntelliJ I ran my ahk script. Doing this fixed my issue above.

Steps to fix

-----------------

1.) turn off ahk script

2.) In the IDE go to File -> Settings -> Keymap

3.) Add the shortcuts you need directly to the "up", "down", "left", "right" commands

4.) At this point you may turn on the ahk script. 

The only reason I use the ahk script even after I manually bind the settings in the IDE itself is because I have other key mappings in the file I still want to use. I hope this helps!

1
Avatar
Permanently deleted user

Thanks I will try it. Though I have more than 100 text and navigation key bindings and scripts in my ahk configuration, and most of them are with LAlt. Some of them don't have an analogue in WebStorm configuration. So if it will work - it will still be only a partial solution. 

0

This is an ongoing issue for me that I've raised here - https://youtrack.jetbrains.com/issue/IDEA-189967

In my case, mapping "ctrl/right-click" to "right-mouse" - as per below .ahk script - doesn't ever show a context (right-click) menu in any JetBrains app, as it should

I run this script as Admin.

```

^LButton::RButton
RButton::LButton

```

RubyMine 2018.2.2
Build #RM-182.4129.29, built on August 20, 2018
JRE: 1.8.0_152-release-1248-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

It works in every app I have installed, except for JetBrains apps.

PS If you're wondering "what's the point?" I'm using a Mighty Mouse on Windows and this allows me to use it just as a Mac (and is very convenient when doing a Remote Desktop session into this Windows machine from a Mac)

 

0

Same issue but I use xmonad to send keypresses not autohotkey.

0

Please sign in to leave a comment.