New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switching Windows With Alt+Tab Sometimes Triggeres Next Step #238
Comments
It was already reported somewhere... Probably long time ago... It should be checked if modifier keys (alt, ctrl, meta) are pressed with tabs (and arrows) and not trigger the next action. |
can't you just remove tab navigation complelty? I mean this: event.keyCode === 9 |
Checking modifier keys doesn't help. I tried to fix this today, but the fact is that when you switch to w browser window with Alt-Tab, the event sent is a normal Tab event. This is on Ubuntu both with Firefox and Chrome. I don't know where the bug is, but the only solution I can find for the time being is to not support the Tab button for the event... |
But, if you don't have an event on Tab key it will have its default behavior in browser - going through focusable elements (like links, form elements, etc). And this may sometimes break what impress.js shows, as browser will catch focus on some element, try to scroll to this element, so presentation will visually move until next slide is shown. Weird, doesn't happen all the time, but that's the main reason why I added Tab key support for moving slides. |
I recently tried this library for a presentation and ran into the same issue using Windows. Every time I alt + tabbed to chrome where the presentation was running, it would go to the next slide. It's a little bit distracting when developing the slides I think. Maybe add a quick option to disable it if needed? This way we can disable it while building the slides, and then switch it on again for normal presentation behaviour. |
In that case I think that the TAB key should be caught, and set so that the default is ignored, but that it doesn't advance to a slide. Just removing the "case 9:" row would do that, I think. |
@regebro Yes, you are probably right. That may be the easiest solution. |
You can add a configuration which keys are attached to next and back. Also the option to autoscroll every X-seconds would be very easy. Or an option to set data-timeout to the dom element, and scroll it after that specifoc time has past. You might get something like (just as an example): This would be user defined which method(s) you want to use |
+1 @leroybaeyens |
can people try this solution and let me know what you find? #312 |
Very annoying 'feature'. I don't know why clicking 'tab' should work for slide change, it is not obvious. Anyway this workaround can help:
(include it before impress.js) |
So, here is what is happening.... (at least Windows) If you are on application A, you press Alt+TAB to switch to the Impress browser. If you are like me, you will release Alt before TAB - at which point the focus goes to the browser with TAB pressed and Alt up. You then release TAB: the browser receives a keyUp event, and a move to the next slide is triggered. Since Alt is not pressed at that time (remember - it was released before the browser got the focus) checking for event.getModifierState( KeyboardEvent.altKey ) does not help. The correct solution is thus I believe not to move to next slide upon pressing TAB. |
maybe a better solution is to memorize if the tab key has also triggered a keydown event. If not, ignore the keyup, else move forward to the next slide. |
Thanks for the analysis @ltregan . |
"maybe a better solution is to memorize if the tab key has also triggered a keydown event. If not, ignore the keyup, else move forward to the next slide." => oh yes, that would work too if we want to keep the TAB key active ! |
@m42e @aliva @regebro @diogovincenzi @leroy0211 @Ivanca @eddiemonge @olegccc @ltregan Can anybody check if this is still an issue on master? |
@FagnerMartinsBrack dude, It's been 4 years from my comment, I can't even remember what is impress.js 😆 |
@aliva Yeah I understand. See this comment though, we are trying to get this project on it's track again and looking for anyone that is still willing to help. |
Related to #550 (comment) |
According to #550 (comment) it seems this was already fixed. I couldn't reproduce it in the We will close this for now and watch to see if this will come up again. |
Switching between windows using Alt+Tab triggers next event when switching to browser most of the time.
I'm not sure how to get rid of this but at least it is mentioned here ;)
The text was updated successfully, but these errors were encountered: