I'm working on IntellijUltimate-2019.2 but have seen this issue on previous versions as well. When I try to create a macro and replay it, it works fine one or two times, but starts doing something else next time onward.
I do have some custom shortcuts setup and I'm running Intellij over RDP. My local system is Ubuntu and RDPing using Remmina.
Has anyone faced similar issues before or have any suggestions on how to fix this?
A silly one, but posting a response here (instead of deleting this post) in case anyone else is running into the same issue.
If you are using a combination of keys to trigger a macro (e.g. Alt, Ctrl or Shift), make sure to leave the first key immediately after pressing the second key, else they will interfere the macro replay.
I was using Alt + J to trigger the macro. The macro included typing "P", but because I wasn't letting go Alt fast enough, instead of typing "P", it was triggering another action that I had mapped against Alt + P.
This is an issue I've ran into before, but I've always given up solving the problem and worked out a work around. Not today (hopefully).
I'm trying to make a bot for the classic Doom II. I want my bot to have access to the main menu which is accessed via the escape key. Naturally I tried:
sendkeys.send("{ESC}")
No luck. But then something weird happened. I accidently ran the code when I was already on the menu... and it closed the menu (which is normal if you press escape on the menu). So clearly Doom II listens to Sendkeys.
I've since tried sendinput, postmessage, and simulateinput. None have worked (they all have the same behaviour as described with sendkeys).
It would be great if someone could ride in on a white horse and give me code to get around this issue, but outside of that can any one simply explain this behaviour to me?
It seems that Zandronum does not accept virtual keys to be sent to it when the game is running (not paused). I'm not sure but it seems that virtual keys might actually be window messages, like Andrew Morton said (or they're at least something similar...). The workaround to this was to send a hardware scan code instead of a virtual key code.
A hardware scan code appears to be the code sent by the actual keyboard when pressing a key, while a virtual key code is the key which the system interprets from the scan code (reference).
So I managed to send keystrokes to Zandronum (both fullscreen and windowed) using a few WinAPI functions:
SendInput() which is used to send the actual keyboard input.
MapVirtualKeyEx() which is used to convert key codes to scan codes, or vice versa.
GetKeyboardLayout() which is used to get the user's current keyboard layout (I, for example, have a Swedish keyboard).
By using the below helper class (or more correctly: wrapper) that I built you may now send keystrokes (hardware or not) in a simple manner, with a larger variety of keys than what SendKeys.Send() includes. You may use any key in the System.Windows.Forms.Keys enumeration.
This was tested with Zandronum and works completely:
InputHelper.Keyboard.PressKey(Keys.Escape, True) 'True = Send key as hardware scan code.
EDIT (2019-09-20)
InputHelper has since long been moved to its own library. The answer has been updated to reflect this change.
Download InputHelper from GitHub:
https://github.com/Visual-Vincent/InputHelper/releases
Just for fun, I also managed to find a list of scan codes on the MSDN: https://msdn.microsoft.com/en-us/library/aa299374(v=vs.60).aspx
Since I'm a Doom fan myself and familiar with how it works, perhaps you should (per your old question) also make sure that you have selected New Game in the menu before you make it press enter?
Zandronum is aware of the names of the menu items, so you just have to give it the first letter and it will jump to the item starting with it:
InputHelper.Keyboard.PressKey(Keys.Escape, True) 'Open the menu.
System.Threading.Thread.Sleep(100) 'Small delay to let the menu open.
InputHelper.Keyboard.PressKey(Keys.N, True) 'Jump to the "New Game" menu item.
InputHelper.Keyboard.PressKey(Keys.Enter, True) 'Go into the "New Game" menu.
InputHelper.Keyboard.PressKey(Keys.Enter, True) 'Start a new game.
I've tested the above code in-game, running in fullscreen mode. Works like a charm.
This is perhaps my first post ever, asking for help on a Windows related problem and I already did all I could to resolve the problem myself but to no avail.
OS: Windows 10.0
Machine: Dell Inspiron 5559 (it's new so I know there is nothing wrong with the hardware)
Here is the predicament I am faced with:
When I use a combination of the RIGHT CTRL, RIGHT SHIFT and an ARROW-KEY to let's say select text in a Word/Google document, the combination works once but does not repeat itself if I keep holding down the keys (it used to on my last laptop which had Windows 7 installed on it).
I have already checked the Ease of Access Center. Sticky, Toggle and Filter keys are all OFF.
I have disabled the Intel HD Graphics hotkeys.
I have researched probably about 20 articles but nothing.
Guys, this is very important for me to fix because I work with text a LOTTTT and have to use this combination very frequently. So any help would be greatly appreciated. Thank you.
PS: LEFT CTRL, LEFT SHIFT and RIGHT (or LEFT) ARROW-KEYS combination still works and it repeats if I press and hold those keys.
But for whatever odd reason, RIGHT CTRL, RIGHT SHIFT and RIGHT (or LEFT) ARROW-KEYS combination is not repeating.
As a point of comparison: my Samsung Windows 10 laptop has the Intel HD Graphics 4000, but I am not running the Intel Graphics Toolbox (just the drivers).
CtrlShift< and …> auto-repeat fine for me - I use them all the time too!
CtrlAlt<, …>, …^ and … v are the rotate commands for me.
My suggestion? Remove the Intel Graphics Toolbox thingy (it doesn't do any more than native Windows does anyway...) and try again. I know you say you've disabled the hotkey features - but who knows if it really has?
I had the same exact thing happening on my PC. It was due to the "Intro" key of the numeric keypad being stuck. Release it and problem gone.
You can easily reproduce the issue by maintaining that key pressed on purpose.
I'm having a strange problem with IntelliJ IDEA 16.1.2 running in Ubuntu MATE 16.04: when I switch between keyboard layouts, then normal typing works as expected, but any control key combinations use the wrong layout. Confused? So am I.
For years I've been using MATE (Linux Mint MATE, Ubuntu MATE) and switching between layouts (Norwegian Dvorak and US English) via MATE's built-in keyboard layout switcher (using CAPS LOCK to switch globally), and this has been working without a single hitch. I love it.
But now I started using IntelliJ, and I find that when I switch layouts, a o e u becomes a s d f as it should, but CTRL-X / C / V and all the others remain on the Dvorak key positions (that is, on qwerty you'd have to type CTRL+B / I / > in order to hit the CTRL-X / C / V on the Dvorak layout. Ditto for all other CTRL-any key commands such as Find, Print, etc.
This is bonkers! And it's only happening in IntelliJ IDEA and PhpStorm. I've never seen this before, and right now those are the only two apps on my system that are affected.
My keyboards are native QWERTY, and I have used the OS to specify Dvorak as the primary layout, with QWERTY as an option and a hotkey to toggle between them.
I use Dvorak almost exclusively; the only reason to have the other layout is for "guests": coworkers during pair work, and my wife on the systems at home.
Dvorak is working 100%, but the querty is not: the querty works for non-ctrl characters, but ctrl stays mapped to Dvorak
This is for the other way around, but may help.
I have seen a setting, where you can switch to dvorak, but key control keys in querty position. I think it is in the keyboard layout system-settings.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm just noticing that on my laptop (Dell XPS 15z) there's no BREAK key (no dedicated number keypad). I'm running the debugger step-by-step and then when all seems fine, I just let it play out. However, it's running in an infinite loop and now I'm realizing there's no way to stop it without the break key!!!!
Is this a bad joke? I had to reboot the computer; is there a more graceful way??
just press the escape key twice ;-)
Solution #1 (It works most of the time):
When some particular keys (Pause, Break or ScrLk) are missing on the keyboard and pressing Esc 2, 3 or multiple times doesn't stop the macro too.
Step #01: If your keyboard does not have a specific key, please do not worry and open the 'OnScreen Keyboard' from Windows Utilities by pressing Win + U.
Step #02: Now, try any of the below option and of them will definitely work depending on your system architecture i.e. OS and Office version
Ctrl + Pause
Ctrl + ScrLk
Esc + Esc (Press twice consecutively)
You will be put into break mode using the above key combinations as the macro suspends execution immediately finishing the current task. For eg. if it is pulling the data from the web then it will halt immediately before executing any next command but after pulling the data, following which one can press F5 or F8 to continue the debugging.
When Solution #1 doesn't work or you need a permanent solution then try adding a new KEY to the Registry. (I am running Win 10 Creators Update on Dell 3530 Inspiron Laptop)
Disclaimer: Please only make changes to Windows Registry at your own risk and it is advisable only if you are windows administrator or have prior experience in the changing the key values in the registry.
You can also look for Solution #2 which use accessibility keyboard Win + U
Solution #2:
1) Click the START, then type REGEDIT into the search box. This will start the registry editor.
2) Explore the Registry, expanding each element
HKEY_LOCAL_MACHINE
-SYSTEM
-Current Control Set
- Control
- Keyboard Layout
Click on the Scancode Map, and EDIT the key values to match that shown below.
i.e. to have values of : 00,00,00,00,00,00,00,00,02,00,00,00,46,e0,44,00,00,00,00,00
Once Done you will need to reboot your laptop, but after that, you can use as the pause/Break Key.
To understand it in detail and customize it as per your needs, please refer this link: KeyBoard Scancodes
I have a Dell Precision without a Pause/Break key but there is a replacement for that: Fn + B, so:
- Fn + B == Pause (pause execution);
- Ctrl + Fn + B == Break (break execution);
- Win + Fn + B == Windows + Pause (open System properties).
You can execute the command:
dir /s C:\
and test the Pause and Break combination keys while dir lists all files in drive C.
reference
Despite this being an old question, I have just encountered the same issue and discovered that Ctrl+Scroll lock works as a break.
"Scroll lock" can be accessed on my DELL Laptop via the blue function key "Fn" and the "F6" key which has a small blue lock symbol on it with an ⇳ symbol in it. At other computers it may look like ⤓ . So effectively I press Ctrl+Fn+F6.
I have an HP laptop and this works when I want to break after a msgbox, hold fn+ctrl and click right shift key (has pause on it as well) then respond to msgbox and code will break.
On my Dell at least : ctrl + alt + esc BEFORE your cursor starts looping itself
I got this info from aidangrogan on this website :
http://en.community.dell.com/support-forums/laptop/f/3518/t/19355018
So I don't claim to have found it myself. All credits to him (or her)
Hold CTRL+Fn & hit Shift - Stopped my macro from running. I don't have a 'Break' key either on the keyboard of my HP Pavilion G7.
Ctrl + Fn + B works for Excel 365 (Office 365) on my Dell Latitude 5480 (no Break key).
I found this thread and saw the solution that has the most votes, but then realized my laptop has no Pause, Break or ScrLk) keys. I tried other proposed solutions, like 'OnScreen Keyboard' or alternative key combinations, but those didn't work either.
Then it hit me: if it's a phantom break point associated with particular line(s) of code, why not just get rid of the line(s)?
So that's what I did:
I cut the line(s) where execution was breaking.
Ran the macro again (it didn't break this time)
Pasted the line(s) again.
It worked for me, when no other key combination (onscreen or physical) worked. Hope it helps someone!
None of the above answers work for me.
I did how ever find this, it's not perfect since you need to keep ALT pressed and then a keys twice. On top of that it's depended on what language your Excel is set to.
In an English Excel you'd use ALT + R + R in German you need to use ALT + U + R
I have a Japanese Layout keyboard. I neither have a scroll lock nor a break on my laptop-Lenovo E470.
A long press on the Esc key worked as a terminator for me.
I found a way round this, opened another instance of Excel and another spreadsheet, then opened the VBA editor from there and it showed as "running" so I could click the stop button
Because all of the above werent working for my application, I ended up writing a VBS script which I can run from the terminal. Not elegant. Probably not the first choice if one of the others work. But, effective.
break.vbs
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "^%{BREAK}"