Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Improved PointingRelativeToScroll (canceling KeyOverlaidModifier)
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Jun 5, 2011
1 parent eb644bf commit 2d1a5e3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/core/kext/RemapFunc/PointingRelativeToScroll.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "Config.hpp"
#include "EventOutputQueue.hpp"
#include "EventWatcher.hpp"
#include "PointingRelativeToScroll.hpp"

namespace org_pqrs_KeyRemap4MacBook {
Expand Down Expand Up @@ -115,6 +116,9 @@ namespace org_pqrs_KeyRemap4MacBook {
}

doremap:
// We need to call EventWatcher::on here.
// See the comments in EventInputQueue::fire_timer_callback.
EventWatcher::on();
toscroll(remapParams);

return true;
Expand Down
18 changes: 14 additions & 4 deletions src/core/kext/util/EventInputQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,13 +527,23 @@ namespace org_pqrs_KeyRemap4MacBook {
if (params) {
// ------------------------------------------------------------
// We set EventWatcher::on only when Buttons pressed.
// It's cause a problem when you use the following settings. (Unexpected FN_Lock is fired).
// - FN+CursorMove to ScrollWheel
// - FN to FN (+ When you type FN only, send FN_Lock)

// ------------------------------
// About PointingRelativeToScroll:
//
// If PointingRelativeToScroll is applied, we should call EventWatcher::on. (== canceling KeyOverlaidModifier)
// When the following settings are activated,
// Fn_Lock should not be fired if the RelativePointerEvent is happened.
//
// - Fn+CursorMove to ScrollWheel
// - Fn to Fn (+ When you type Fn only, send Fn_Lock)
//
// But, if we call EventWatcher::on every CursorMove event, unexpected cancel occurs.
// It's more terrible than above problem.
// So, we keep to call EventWatcher::on only when Buttons pressed.
//
// Therefore, we call EventWatcher::on in PointingRelativeToScroll::remap.
// So we don't need to call EventWatcher::on unless just buttons are pressed or released.

if (params->ex_button != PointingButton::NONE) {
EventWatcher::on();
}
Expand Down

0 comments on commit 2d1a5e3

Please sign in to comment.