Capturing spacebar press?
-
Have the 3CX webchat plugin installed, but not capturing the spacebar presses. Suggestion is the theme is capturing this. Can we fix this?
The page I need help with: [log in to see the link]
-
Hi there,
what do you mean with “Suggestion is the theme is capturing this”?
Do you mean that you’ve found the theme to be responsible for this, e.g. switching to another theme the issue doesn’t occur, or keeping this theme but disabling any other plugin?Thanks.
Please see following thread: https://www.3cx.com/community/threads/click2talk-wordpress-plugin-space-key.64638/
-
This reply was modified 6 years, 7 months ago by
chriswhiting84.
Thanks,
from a rapid look I couldn’t see any reference to the Customizr code there…Anyway, looking at the source of your website:
view-source:https://poynter.net/
I can see the culprit code:<script> jQuery(document).ready(function($){ window.onkeydown = function(e) { return !(e.keyCode == 32); }; });32 is the keycode for the spacebar 😀
That code is not part of the theme, but cannot tell you where it comes from: a plugin? your child-theme?
If you cannot find where it comes from I suggest you:
1) switch back from the child-theme to the parent theme
2) disable any other plugin.Hope this helps 🙂
Best.
Hi,
Thanks, I’ve found that is a customizr heading, but removing it makes no difference.
Looks like the issue is JS, specifically elements > Event listeners > keydown > window
which is a js file tc-scripts.min.js
dont know what to remove yet though
found it, just removed
spacebar: 32,
and now its working fine.
I’m not positive it’s something in the tc-scripts.min.js
If it was a theme issue it would prevent using the spacebar throughout the site, meaning that all the theme users couldn’t use the spacebar in comments or any other forms too, and that’s not the case.Thanks, I’ve found that is a customizr heading, but removing it makes no difference.
What do you mean with customizr heading?
Looks like the issue is JS, specifically elements > Event listeners > keydown > window
which is a js file tc-scripts.min.js
How did you find the culprit is that file, sorry I don’t understand.
If you could point me in the right direction maybe I could help you.I wonder if the smoothscroll might cause that conflict.
Would you mind trying to disable the option
Appearance -> Customize -> Global Settings -> Smooth Scroll -> Enable Smooth Scroll
?where?
Did you remove:
spacebar: 32
fromvar key = { left: 37, up: 38, right: 39, down: 40, spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36 };?
If so, I suggest you to disable the smooth scroll option as suggested above, because with the next theme update you’ll lose your change.Anyways glad you solved.
Best regards.
It was from this section:
()), function () {
var t,
e,
n = {
frameRate: 150,
animationTime: 400,
stepSize: 120,
pulseAlgorithm: !0,
pulseScale: 4,
pulseNormalize: 1,
accelerationDelta: 20,
accelerationMax: 1,
keyboardSupport: !0,
arrowScroll: 50,
touchpadSupport: !0,
fixedBackground: !0,
excluded: “”
},
i = n,
o = !1,
r = !1,
s = {
x: 0,
y: 0
},
a = !1,
l = document.documentElement,
c = [],
d = /^Mac/.test(navigator.platform),
u = {
left: 37,
up: 38,
right: 39,
down: 40,
pageup: 33,
pagedown: 34,
end: 35,
home: 36
};
i = n;
function h() {
if (!a && document.body) {
a = !0;
var n = document.body,
s = document.documentElement,
c = window.innerHeight,
d = n.scrollHeight;yes that’s the smooth scroll, se my comment above 😉
Thanks!
Thanks, I’ll switch it off
-
This reply was modified 6 years, 7 months ago by
The topic ‘Capturing spacebar press?’ is closed to new replies.
