Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/cpp/webdriver-interactions/event_firing_thread.h
2867 views
1
/*
2
Licensed to the Software Freedom Conservancy (SFC) under one
3
or more contributor license agreements. See the NOTICE file
4
distributed with this work for additional information
5
regarding copyright ownership. The SFC licenses this file
6
to you under the Apache License, Version 2.0 (the "License");
7
you may not use this file except in compliance with the License.
8
You may obtain a copy of the License at
9
10
http://www.apache.org/licenses/LICENSE-2.0
11
12
Unless required by applicable law or agreed to in writing, software
13
distributed under the License is distributed on an "AS IS" BASIS,
14
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
See the License for the specific language governing permissions and
16
limitations under the License.
17
*/
18
19
#ifndef event_firing_thread_h_
20
#define event_firing_thread_h_
21
22
/**
23
* The purpose of background, persistent event firing is to make mouse hovering
24
* on Windows work. IE, specifically, would consider the mouse to have moved
25
* outside the window if WM_MOUSEMOVE messages are not constantly sent to
26
* the window.
27
*
28
* This is achieved by starting a background thread that keeps firing those
29
* messages every 10 ms. Event firing is paused when other mouse actions occur.
30
* Additionally, the state of the input devices must be updated so that
31
* WM_MOUSEMOVE events sent are consistent with previous actions. This
32
* boils down to whether the Shift key is pressed and whether the left
33
* mouse button is pressed (for drag-and-drop to work).
34
**/
35
// Start or resume persistent "mouse over" event firing by a
36
// background thread.
37
extern void resumePersistentEventsFiring(
38
HWND inputTo, long toX, long toY, WPARAM buttonValue);
39
// Resume without changing the target. Used after pausing evennt
40
// firing for mouse actions.
41
extern void resumePersistentEventsFiring();
42
// Pauses persistent event firing by the background thread.
43
extern void pausePersistentEventsFiring();
44
// When the state of the shift key changes, update the background thread
45
// so that subsequent mouse over events will have the right keyboard state.
46
extern void updateShiftKeyState(bool isShiftPressed);
47
// When the left mouse button is pressed, update the background thread.
48
// Otherwise IE gets confused.
49
extern void updateLeftMouseButtonState(bool isButtonPressed);
50
#endif // event_firing_thread_h_
51
52