I regularly have my game open on one virtual desktop and my music player open on another. I switch between the desktops using some keyboard shortcuts to change the music that is currently played. After coming back to factorio sometimes believes that the CTRL is being pressed while it isn't.
My shortcuts are configured to CTRL+ALT+Arrow Keys. I run Linux Xubuntu 14.04.4 LTS with Gnome and Xserver.
Exact steps to reproduce:
1. Start factorio
2. Go into fullscreen mode
3. Start some game
4. Walk to tree and chop is down by holding the right mouse button.
5. Switch virtual desktop away from factorio using CTRL+ALT+Right
6. Switch virtual desktop back towards factorio using CTRL+ALT+Left
7. Release first the CTRL key, release then the ALT key
8. Walk to next tree. Holding the right mouse button no longer chops trees because factorio thinks that the CTRL key has never been released.
Fix: Hit the CTRL key a second time while being on the factorio virtual desktop.
The bug does not occur if the ALT key is released before the CTRL key.
This problem happens in fullscreen and window mode.
This is either a bug where Allegro does not generate the ALLEGRO_EVENT_KEY_UP for the CTRL key or a bug in factorio where it does not process the corresponding event correctly.
Anyway, the bug is unproblematic once you realized that you just have to hit the CTRL key to fix it. However, I needed some time to realize this and restarted my game quite often before I figured it out. Restarting the game is annoying.
