Giving to FLAUI the command for hit a key combination (such as ALT + F4) changes the keyboard controls - xunit

i'm making an automated test with flaui, it includes
Keyboard.Press(VirtualKeyShort.ALT);
Keyboard.Press(VirtualKeyShort.F4);
it works fine, but then my keyboard controls are completely different, for example i'm not able anymore to write using letters because they have different behavior, what i need to do for restore them is by performing again ALT + F4. I also tried using different keyboard but is the same, help pls!!
what i need to do for restore them is by performing again ALT + F4. I also tried using different keyboard but is the same, help pls!!

You have to use the .TypeSimultaneously() method, like below:
Keyboard.TypeSimultaneously(VirtualKeyShort.ALT, VirtualKeyShort.F4);
See the full documentation here.

Related

Mac OS option key shortcuts not working, how to make it work?

I have a very long line which I want to view as wrapped.
There is an option called word wrap that can help me achieve this.
Anyhow the shortcut method option + z doesn't work, instead inserts a ˀ there.
Any solutions?
Looks like one of your extension might be overriding your VSCode config. Try ⌘+SHIFT+P/CMD+SHIFT+P and then search for View: Toggle Word Wrap/Toggle Word Wrap.
You will then be able to see the shortcut assigned to that command on your local PC. Alternatively, ⌘+SHIFT+P/CMD+SHIFT+P and search for Keyboard Shortcuts. In there search for OPTION+z and check for the answers which pop up.

Using Alt Key in FakeVim mode of Qt Creator?

It's really handy when you work with VIM text editor to use Alt key to execute normal mode commands in insert mode, for example when you are in insert mode you can press Alt + j to go one line down. But in FakeVim mode of Qt creator this couldn't be done. Any suggestion is welcome.
Pressing Esc each time you want to go to normal mode really sucks.
(not a fix to your problem, just discussing it in a properly formatted text)
I never hit <ESC> as well, and this is a deal breaker for me. Note that it's not a vim feature, though : this behavior occurs because using Alt with an other key in terminals generates an escape sequence. So there's nothing wrong with FakeVim regarding Alt implementation, the problem is related to the IDE being a QT window. You can't use Alt sequence in GTK's Gvim as well, for the same reason, last time I checked.
A possible easy fix on the QCreator part : provide an option to not pass Alt combinations, like the one existing for Ctrl. That is, if QT allows that. We could then at the very least define vim bindings using Alt key to simulate the terminal behavior.
In the list of others exotic combinations from terminals that quickly lead to form habits in vim, I also use C-j in place of <return>, and C-h instead of <backspace>. Those would really be nice to have too :)

How do I move through intellisense suggestions with a keyboard shortcut?

When I write something like Console. I get suggestions like Console.Write and Console.WriteLine. I don't want to use the arrow keys, they are too far away, how do create a shortcut for that? I would prefer something like shift+o for moving up and shift+k for moving down.
Try TouchCursor, it lets you use the home keys as cursor key
TouchCursor
You can always remap the keyboard shortcuts to do what you want. See my answer here: https://stackoverflow.com/a/18744507/958809
I don't if there is an alternative for navigating one by one but you can use the first letters of every word to quickly find what you are looking for.
Typing Console.wl will quickly bring up Console.WriteLine. It's available by ReSharper I think.
You don't even have to type the first letters by the order. Typing avl can bring up SomeMethodWithAVeryLongName.
I don't know solutions within Visual Studio and ReSharper.
But maybe a remapping of keyboard keys can help, i.e. remap Caps Look key to Arrow Down key. See http://www.askdrtech.com/solutions/post/How-to-change-keyboard-mapping.aspx for explanation.
I think your problem is just this: Ctrl + Alt + Space
In VS Code, go to File > Preferences > Keyboard Shortcuts
Search for suggest select in the search bar
the ones you want to change are selectNextSuggestion and selectPrevSuggestion. I mapped mine to TAB and shift + TAB, respectively, to free my arrow keys.
There's plenty of cool stuff you can customize for Intelisense. Check the documentation page: https://code.visualstudio.com/docs/editor/intellisense

Remap Caps lock key to Esc in Mma 7

TLDR: How do I get CapsLock to translate to "ShortNameDelimiter" in Mma 7?
I like pretty text in my mma notebooks, and often define functions as f[\[Alpha]_] =... so as to match the exact equation that I'm working with. As such, it involves a lot of Esc-letter-Esc sequences, and reaching for Esc every other stroke breaks my flow of typing.
Now, the CapsLock key is seldom used (I can't remember the last time I needed it), but conveniently placed (your pinky is right there!). Remapping it to Esc on vim worked wonders for me and I was wondering if there was a way to do the same in mma, without having to modify the system's keyboard layout.
I tried editing KeyEventTranslations.tr by adding the following in EventTranslations[{...
Item[KeyEvent["CapsLock"], "ShortNameDelimiter"]
but that had no effect. Is there another way to do it? Is CapsLock not the correct identifier? If it helps, I'm using Mma7 student version on a Mac.
Modifier keys are handled quite specially, and I doubt Mathematica will be able to override the system. You probably have to do this in a layer between Mathematica and the OS. BUT, it is possible to make the key behave different depending on the application you are in. Thus with a bit of work, it MAY be possible to have the capslock key behave differently only in Mathematica.
edit: I did not see you say which operating system you had, so I've added Mac instructions.
Windows
For example, if you have Windows, you can use the program called http://www.autohotkey.com/ . It specifically has a feature where you can bind a key to a script, specifically the following script:
How can a hotkey or hotstring be made exclusive to certain program(s)?
In other words, I want a certain key to act as it normally does except when a specific window is active.
In the following example, NumpadEnter is made to perform normally except when a window titled "CAD Editor" is active. Note the use of the $ prefix in "$NumpadEnter", which is required to let the hotkey "send itself":
$NumpadEnter::
IfWinNotActive, CAD Editor
{
Send, {NumpadEnter}
return
}
; Otherwise, the desired application is active, so do a custom action:
Send, abc
return
This next example is more pure than the above, but it will only work if the "CAD Editor" application is designed to ignore the NumpadEnter key itself. The tilde prefix (~) makes NumpadEnter into a non-suppressed hotkey, meaning that the NumpadEnter keystroke itself is always sent to the active window, the only difference being that it triggers a hotkey action. The ~ feature requires Windows NT/2k/XP.
~NumpadEnter::
IfWinNotActive, CAD Editor
return
; Otherwise, the desired application is active, so do a custom action:
Send, abc
return
To quote from "MRCS" in this forum post, you may find the following useful:
The first one I named CapsLockR.ahk and contains the following script:
CapsLock UP::Run C:\Documents and Sett...[path to script]...\CapsLock.ahk
The second one is named CapsLock.ahk and has this script:
GetKeyState, state, CapsLock, T
if state = D
SetCapsLockState, off
else
SetCapsLockState, on
exit
Thus worse comes to worst, if you are having trouble modifying the "Behave like Foo if Active Window = Mathematica else behave like Bar" script, you can tack on this to manually toggle the CapsLock state I think. Googling will also reveal more results.
Linux
I know that on Linux, you can use the program called xbindkeys to bind the CapsLock to a script, from which you can in turn call xdo if you detect Mathematica is one of the topmost windows (e.g. via Getting pid and details for topmost window , or xdotool getwindowfocus) or worse-comes-to-worst, you can just have a script which toggles your configuration between CapsLock -> xdotool key Escape, xdotool type "whatever", xdotool key Escape ("Mathematica mode") and "normal mode"... though that may prevent you from YELLING AT MATHEMATICIANS OVER INSTANT MESSAGING WHILE DOING MATHEMATICS. Unless you You may need to find some way to programatically toggle CapsLock, perhaps by creating a dummy CapsLock key (though that's an extreme hack, it is likely one can find some kind of library; perhaps Anybody know how to toggle caps lock on/off in Python? may be useful). (This issue could be avoided by using a key besides CapsLock, or not caring that you want to keep your CapsLock functionality; you could also just turn another key you never use into CapsLock.)
Mac
Mac may have similar tools. For example, you can get xdotool like on Linux above via the MacPorts project. I hear the CapLock key cannot normally be rebound as easily on Mac, so if you can deal with another key it may be much easier. But theoretically it should be possible...
If you wish to use CapsLock, you can use PCKeyboardHack http://pqrs.org/macosx/keyremap4macbook/extra.html to remap the CapLock key to something which will tell OS X to let you remap the CapsLock. Then you remap it, then bind the key using Quicksilver to a script that makes calls xdotool to check if you're in Mathematica also also to issue the :esc:...:esc: if you are (see the Linux section of this answer). Otherwise you simulate a keypress on the CapsLock. But you remapped CapsLock! So you might need to make another dummy key you never use into the CapsLock key, and trigger a keypress on that using Cocoa libraries or a simple AppleScript. If you wish to pursue the CapsLock route, you might find Using Caps Lock as Esc in Mac OS X useful.

VS2010 Debugging: Display Datatip w/o mouseover (use keyboard)?

I'm in VS2010, on a breakpoint. How can I cause a datatip to be displayed for a given variable/expression w/o using my mouse to hover it?
That can't be done, exactly, but you can get the same result by selecting the variable you want to watch (using ReSharper's Ctrl + Alt + →/← can speed this up), and pressing Shift + F9, which will raise "QuickWatch" modal window with the datatip contained within.
If you prefer, you can also go into Options->Keyboard and bind the Debug.AddWatch to a different keyboard shortcut, and use that instead of Shift + F9, and then your variable data will persist in the Watch window so you can come back to it later (as suggested here)
You can also do this by opening the command window (Ctrl + Alt + A) and typing Debug.AddWatch variable_name.
While you can pin multiple windows in VS it will be a somewhat cumbersome experience and you will have to over it.
I personally use visual studio plugin called Oz Code, that automatically annotates all the local variables and intermediate results so I don't have to chose which variables to pinpoint.
The results looks something like this:
Will adding a watch not be suitable? When you hit your breakpoint the relevant details of the variable will be shown in the watch window.
Perhaps I have misunderstood what you're trying to achieve here!
You can click the 'pin' icon to force any datatip to stay open, and it will update to the current contents when you hit the breakpoint.
I don't know of a way to open a specified tip without pinning it, however.
The Locals and Autos windows might be helpful as they show all local variables, (they even show the return value of called functions!).
Note however that they show directly only variables in scope, so if you need a detail property that it is not yet menotioned in the code you can drilldown using the →/← keys, however if it is already mentioned in the code in the current scope then you should be able to see it directly in the Autos window.

Resources