How to send an addition sequence after an input without interferring other combination with it? - mouseevent

I want whenever a LButton, ^PgUp or ^PgDn is active, it should also send an addition sequence after it. From Function hotkeys and A_ThisHotkey I can use:
LButton::
PgUp::
PgDn::
Send {%A_ThisHotkey%}!wi
But then mouse drag is not functional anymore, and it's ^PgUp that should be re-assigned, not PgUp. But none of these works:
^PgUp::Send {%A_ThisHotkey%}!wi
PgUp::Send ^{%A_ThisHotkey%}!wi
^PgUp::Send ^{%A_ThisHotkey%}!wi
How to do this properly? My workaround is just to divide and rule:
^PgUp::Send ^{PgUp}!wi
^PgDn::Send ^{PgDn}!wi
But I like to use A_ThisHotkey for learning purpose.

Try:
~LButton Up::
~^PgUp Up::
~^PgDn Up::Send !wi

Related

Is there a keyboard shortcut to select a column for editing in Atom editor?

Scenario
When editing a file in Atom Editor how do I select multiple lines where the same edit needs to be performed?
For example:
this.name = name;
this.age = age;
this.sound = sound;
needs to be transformed into:
that.name = name;
that.age = age;
that.sound = sound;
Imagine there are many of these lines, but we do not want to use a find-and-replace because it will change more than we need.
Question - Is there a Keyboard Shortcut for Column Selection?
Is there a sequence of keyboard shortcuts (preferably Mac) which we can use to:
a) select the initial word
b) select the "column" (that word on several lines)
then apply the change to several lines at once (in bulk)
I know how to do this in SublimeText:
http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/editing/editing.html#column-selection but have tried many different key combinations without any luck in Atom and googling has proved fruitless...
There are several ways to achieve this:
Keyboard
You can enable column selection mode using Ctrl+Shift+↑/↓. This will allow you to extend the cursor to multiple rows. Once you have selected all rows, release the keys, and use the Delete key to remove the text you want to replace. Once you're done, press the Esc key to release the cursors.
Note: You will have to disable the Mission Control (key bindings) in OS X to use this key combo.
How to Disable Mission Control (conflicting) Key Bindings (Mac)
To do this open System Preferences > Mission Control
Locate the key bindings for Mission Control and Applications windows:
Disable the key bindings for these two:
More details here.
Mouse
If you install the Sublime Style Column Selection package, you can use Alt+Mouse to select the columns in question.
More details here.
Here is a plugin for Atom, just hold alt and be happy.
sublime-style-column-selection
With the cursor somewhere on the first "this", do Ctrl+D (OS X: command+D) three times. Then type "that".
Another option is to select the rows you want to edit. Then select "Split into Lines" from the "selection" menu. Then hit the home-key and start editing away in multi-cursor mode.
For me on Atom 1.7.4 it worked by adding below lines to my /Users/username/.atom/keymap.cson. Ofcourse I am using alt-shift-down as shortcuts.
'atom-workspace atom-text-editor:not([mini])':
'alt-shift-down': 'editor:add-selection-below'
Update: I could not configure both alt+shift+down and alt+shift+up at the same time. For now I am okay with alt+shift+down
On Windows 10, follow the following steps:
Press ctrl + alt together and use up/down arrow keys to expand the height of your now vertical cursor
Now use shift to select the columns to be deleted
press delete key to remove selected columns
click anywhere on document (without pressing ctrl/alt keys) to bring cursor back to normal 1 column height
I came by this thread, and the feature I was personally looking for was the multi-cursor extension.
I've tried all of the following potential solutions:
sublime-style-column-selection
multi-cursor
multi-cursor-plus
Adding the following text to /Users/$(whoami)/.atom/leymap.cson
'atom-workspace atom-text-editor:not([mini])':
'alt-down': 'editor:add-selection-below'
'alt-up': 'editor:add-selection-above'
The last solution is the one that worked best without interfering with any of my other normal workflows.

Xbox One Right Trigger Not Working

I have an Xbox One controller setup with Unity3d, and when I try to use the RT button nothing happens.
With the following setup, the RB button works fine:
I have looked at this but setting that up doesn't make sense to me. I have tried 3rd Axis 0_10th and I have tried 3rd Axis 0_1 but those are not valid. What is the proper settings for this to work?
To the get the result I was looking for, I needed to set it up the following way:
Then to get the button to work we need to use:
if(Mathf.Round(Input.GetAxisRaw("Fire1")) < 0){
// Firing code here
}
instead of:
if(Input.GetButton("Fire1")){
// Firing code here
}
Yes, thanks for posting. I was having the same problem using a 360 wired controller in Unity3d. It looks like the Left and Right triggers now both use the 3rd axis (Joystick) with the Left generating positive (0 to +1) values and the Right trigger generating negative (0 to -1) values. This differs from all the documentation I was finding.

Clear TextField rather than append

I'm using the following statement to clear text filed value:
input.value("abc")
input.value("")
input.value("def")
But, instead of clearing and set new value, it is appending the new value to old value. ('abcdef').
Is there any way to clear the TextField, before setting new val?
You can clear using the selenium element:
input.firstElement().clear()
And you can send keys using << like so:
input << "abc"
You can use the selenium Keys to backspace the texts that you already had entered. You can try many different ways to accomplish that. Here is a simple way to do that:
import org.openqa.selenium.Keys
input.value("abc")
input.value(Keys.chord(Keys.CONTROL, "A")+Keys.BACK_SPACE)
input.value("def")
It should do the job. Let us know whether it worked for you or not!
Cheers#!

How to simulate a selection from a SELECT control in sfTestBrowser

In a functional test in symfony, sfTestBrowser provides methods
click() "Simulates a click on a link or button."
select() "Simulates selecting a checkbox or radiobutton."
and unselect().
But I have not found a way to simulate making a selection from a <select> element.
Does anybody know a way to do this?
This has troubled me too. I'm assuming you just want to set the value for form submission? If you know the value, you can of course just do
$browser->click('Save', array(
'theselectfield' => 'desired_value'
));
But usually I don't know the value I want posted, because it's from a database-driven select box. So my solution is
$theOption = $browser->getResponseDomCssSelector()->matchAll('select[name*=name_of_select_field] option:contains(TheOptionTextYouWant)')->getNode();
$browser->setField('theselectfield', $theOption->getAttribute('value'));
... or use $browser->click() instead ...
Frustrating because you have to break out of the $browser call chain, in order to use getResponseDomCssSelector(), but I haven't found an easier way.

Simulate TAB keypress event in Selenium RC

I need to simulate a tab keypress in Selenium RC, using the Java API.
I do this after having entered some text using:
selenium.type(input, "mytext");
I've tried 3 alternatives to get the tab working:
selenium.keyPress(input, "\\9");
and:
selenium.focus(input);
selenium.keyPressNative("09");
and even:
selenium.getEval("var evt = window.document.createEvent('KeyboardEvent');evt.initKeyEvent ('keypress', true, true, window,0, 0, 0, 0,0, 9,0);window.document.getElementsByTagName('input')[2].dispatchEvent(evt);")
The best I can get is a "tab space" to be inserted after my text so I end up with this in the input field:
"mytext "
What I actually want is to tab to the next control. Any clues? Thanks!
(Note: I have to use tab and can not use focus or select to chose the element I want to go to, for various reasons, so no suggestions along these lines please!)
selenium.keyPressNative(java.awt.event.KeyEvent.VK_TAB + "");
I don't use the Java API, but this post from google groups suggests it is your solution. I can't imagine that "9" is different from "09" in your question, but give it a try?
Try the official TAB char: \t or \u0009
Some functions may used Onblur. It will trigger the function when the field lose the key focus. here we can use fireEvent with "blur" or "focus" command as follows:
command: fireEvent
target: id=your_field_identification
value: blur
Reference: http://qaselenium.blogspot.com/2011/01/how-to-triger-tab-key-in-selenium.html
Improvising Ryley's answer, we can use
selenium.keyDownNative(java.awt.event.KeyEvent.VK_TAB + "");
selenium.keyUpNative(java.awt.event.KeyEvent.VK_TAB + "");
I tried this method for VK_CONTROL in IE and it worked good.
Use typeKeys():
Quoting the above link:
Unlike the simple "type" command, which forces the specified value into the page directly, this command may or may not have any visible effect, even in cases where typing keys would normally have a visible effect. For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in the field.
In some cases, you may need to use the simple "type" command to set the value of the field and then the "typeKeys" command to send the keystroke events corresponding to what you just typed.