robot
robot copied to clipboard
Problem simulating Shift+Insert, Shift+Delete keyboard combinations in windows
There is an issue of simulating some keyboard combinations in windows. The combinations of the form shift+{smth}, where {smth} is 'ins', 'del', 'home', 'end', 'pgup', 'pgdn', or arrow keys are not simulated properly. The 'shift' keypress is not simulated in this situation.
It seems to me, that the similar problem is described in the following blogpost: http://letcoderock.blogspot.ru/2011/10/sendinput-with-shift-key-not-work.html
Here is a snippet of the simulation code I am using:
ROBOT_NS::KeyList sequence;
auto result = ROBOT_NS::Keyboard::Compile("+{INSERT}", sequence);
for (auto const & key_event : sequence) {
if (key_event.first) {
keyboard.Press(key_event.second);
} else {
keyboard.Release(key_event.second);
}
}
This code simulates just an 'insert' keypress instead of shift+insert.