From f89b58f04af3eae05de9e999c39b2fe047fe6f4a Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 28 Feb 2016 06:48:03 +0000 Subject: Key bindings; more tweaks and fixes. Miscellaneous fixes and tweaks, including: - Reinstate key logging. - Fix count handling in line with expected behaviour in #2024. - Remove `noCount` option; we don't need it. - Simplify logic in various places. Fixes #2024. --- content_scripts/mode.coffee | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'content_scripts/mode.coffee') diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee index 454a6ed9..efbc9cf4 100644 --- a/content_scripts/mode.coffee +++ b/content_scripts/mode.coffee @@ -120,20 +120,13 @@ class Mode singletons[key] = this # If @options.trackState is truthy, then the mode mainatins the current state in @enabled and @passKeys, - # and calls @registerStateChange() (if defined) whenever the state changes. The mode also tracks the - # current keyQueue in @keyQueue. + # and calls @registerStateChange() (if defined) whenever the state changes. if @options.trackState @enabled = false @passKeys = "" - @keyQueue = "" @push _name: "mode-#{@id}/registerStateChange" - registerStateChange: ({ enabled: enabled, passKeys: passKeys }) => @alwaysContinueBubbling => - if enabled != @enabled or passKeys != @passKeys - @enabled = enabled - @passKeys = passKeys - @registerStateChange?() - registerKeyQueue: ({ keyQueue: keyQueue }) => @alwaysContinueBubbling => @keyQueue = keyQueue + registerStateChange: ({ enabled: @enabled, passKeys: @passKeys }) => @alwaysContinueBubbling => # If @options.passInitialKeyupEvents is set, then we pass initial non-printable keyup events to the page # or to other extensions (because the corresponding keydown events were passed). This is used when -- cgit v1.2.3 From 6e37f605fe45ee5eca03153c35c55c231e703c95 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 28 Feb 2016 11:07:21 +0000 Subject: Key bindings; minor tweaks. --- content_scripts/mode.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'content_scripts/mode.coffee') diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee index efbc9cf4..8a84457e 100644 --- a/content_scripts/mode.coffee +++ b/content_scripts/mode.coffee @@ -119,8 +119,7 @@ class Mode @deactivateSingleton @options.singleton singletons[key] = this - # If @options.trackState is truthy, then the mode mainatins the current state in @enabled and @passKeys, - # and calls @registerStateChange() (if defined) whenever the state changes. + # If @options.trackState is truthy, then the mode mainatins the current state in @enabled and @passKeys. if @options.trackState @enabled = false @passKeys = "" -- cgit v1.2.3 From f2bced459457dcc962d4bafe2fdf2e6245506ee3 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 28 Feb 2016 16:07:25 +0000 Subject: Key bindings; tweaks. --- content_scripts/mode.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'content_scripts/mode.coffee') diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee index 8a84457e..3327b58f 100644 --- a/content_scripts/mode.coffee +++ b/content_scripts/mode.coffee @@ -125,7 +125,7 @@ class Mode @passKeys = "" @push _name: "mode-#{@id}/registerStateChange" - registerStateChange: ({ enabled: @enabled, passKeys: @passKeys }) => @alwaysContinueBubbling => + registerStateChange: ({ enabled: @enabled, passKeys: @passKeys }) => @continueBubbling # If @options.passInitialKeyupEvents is set, then we pass initial non-printable keyup events to the page # or to other extensions (because the corresponding keydown events were passed). This is used when -- cgit v1.2.3 From 29708b3297a645966f7943682f8f7b8c2a332297 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Mon, 29 Feb 2016 06:48:27 +0000 Subject: Key bindings; refactor passKeys distribution. It makes more sense to pass the passKeys directly to normalMode. So, do so, and remove the trackState mode option - which isn't otherwise being used. --- content_scripts/mode.coffee | 8 -------- 1 file changed, 8 deletions(-) (limited to 'content_scripts/mode.coffee') diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee index 3327b58f..205b8288 100644 --- a/content_scripts/mode.coffee +++ b/content_scripts/mode.coffee @@ -119,14 +119,6 @@ class Mode @deactivateSingleton @options.singleton singletons[key] = this - # If @options.trackState is truthy, then the mode mainatins the current state in @enabled and @passKeys. - if @options.trackState - @enabled = false - @passKeys = "" - @push - _name: "mode-#{@id}/registerStateChange" - registerStateChange: ({ enabled: @enabled, passKeys: @passKeys }) => @continueBubbling - # If @options.passInitialKeyupEvents is set, then we pass initial non-printable keyup events to the page # or to other extensions (because the corresponding keydown events were passed). This is used when # activating link hints, see #1522. -- cgit v1.2.3