// While some events may appear to have a fixed value,
// events like scrolling will have higher values with more "agressive" scrolling.
// *2 to create a "gap" between events (since multiplying by two means that all resulting values will be even, the odd numbers between will be missing),
// +1 if the event has a negative value to "fill" the gap (since adding one shifts the parity from even to odd),
// and adding DISGUISED_EVENT_OFFSETTER,
// so that the total as a keycode corresponds to one of the custom aliases that
// are created in config::key::parse_key specifically for these "disguised" relative events.
// The OS interprets a REL_X event¹ combined with a REL_Y event² differently if they are separated by synchronization event.
// This test and test_cursor_behavior_2 are meant to be run to demonstrate that fact.
// ¹Mouse movement along the X (horizontal) axis.
// ²Mouse movement along the Y (vertical) axis.
// The only difference between test_cursor_behavior_1 and test_cursor_behavior_2 is that
// test_cursor_behavior_1 adds a synchronization event between REL_X and REL_Y events that would not normally be there.
// In other words, test_cursor_behavior_2 represents what would occur without Xremap intervention.
// Here's how to proceed :
// 1 - Move your mouse cursor to the bottom left of your screen.
// 2 - either run this test with sudo privileges or while your environnment is properly set up (https:// github.com/k0kubun/xremap#running-xremap-without-sudo),
// so that your keyboard and/or mouse may be captured.
// 3 - Press any button (don't move the mouse).
// 4 - Note where the cursor ended up.
// 5 - Repeat steps 1 through 4 for test_cursor_behavior_2.
// 6 - Notice that the mouse cursor often ends up in a different position than when running test_cursor_behavior_1.
//
// Notes :
// - Because emitting an event automatcially adds a synchronization event afterwards (see https:// github.com/emberian/evdev/blob/1d020f11b283b0648427a2844b6b980f1a268221/src/uinput.rs#L167),
// Mouse movement events should be batched together when emitted,
// to avoid separating them with a synchronization event.
//
// - Because a mouse will only ever send a maximum of one REL_X and one REL_Y (and maybe one REL_Z for 3D mice?) at once,
// the only point where a synchronization event can be added where it shouldn't by Xremap is between those events,
// meaning this bug is exclusive to diagonal mouse movement.
//
// - The call to std::thread::sleep for five milliseconds is meant to emulate
// the interval between events from a mouse with a frequency of ~200 Hz.
// A lower time interval between events (which would correspond to a mouse with a higher frequency)
// would cause the difference between test_cursor_behavior_1 and test_cursor_behavior_2 to become less noticeable.
// Conversely, a higher time interval would make the difference more noticeable.