Maniphest T26208

Shift key stays pressed in Ctrl+Shift+Alt combination
Closed, Resolved

Assigned To
Nathan Letwory (jesterking)
Authored By
Dany Lebel (axon_d)
Feb 24 2011, 9:17 PM
Tags
  • BF Blender
Subscribers
Alexander Kuznetsov (alexk)
Dany Lebel (axon_d)
Nathan Letwory (jesterking)
Ton Roosendaal (ton)

Description

When pressing Ctrl+Shift+Alt, the Shift key stays in a pressed state. This seems to occur in every type of window. This bug may have some relation with this one : http://projects.blender.org/tracker/index.php?func=detail&aid=25476&group_id=9&atid=498
To get out of this state the user must press Shift again. This brings many confusing situations.

System : Windows Vista 64 on a 32 bit machine (also occured on Windows Vista 32 on another 32 bit machine)
rev : 35116, It also occured at rev. 34116 (yes exactly 10 000 rev. ago! but maybe older)

Sytem-info is attached.

Steps to reproduce :
-Open Blender
-Press simultaneously Ctrl+Shift+Alt keys in any window
-Then in the 3d view, middle click and move the mouse to rotate the view
-Notice that the view is not rotating but panning (Shift again to get out of this state)


Also Notice in System-info that bpy.app.build_revision returns -UNKNOWN- instead of the revision number. This occurs since at least 34995.

Event Timeline

Dany Lebel (axon_d) edited a custom field.Feb 24 2011, 9:17 PM
Dany Lebel (axon_d) attached 1 file(s): F14579: system-info.txt.
Alexander Kuznetsov (alexk) added a comment.Feb 25 2011, 6:38 AM

Confirmed
But it is really hard to replicate. I was able to do it twice so it will be hard to debug.
Similar bug is with Ctrl+Shift+Alt+Win

I will look into this.

Dany Lebel (axon_d) added a comment.Feb 25 2011, 7:19 AM

Ok, I forgot to mention something. I work on a laptop with a usb keyboard. With that setup the bug occurs 100% of the time. If you have one close, you could try to see if you get a better ratio. I tried it with the laptop keyboards and it is still possible to do it on both systems, but at a lower ratio. It seems to be easier to replicate with the slower computer. Here are the specs of my computers to give you an idea: core 2 duo 2GHz, Pentium dual cpu 1.46GHz

To facilitate replication, you can do Ctrl+Shift+Alt directly in the 3d view. And sometimes it is Ctrl that stays pressed and keep zoooming. But Alt never did it, at least it never made the view point to snap.

Alexander Kuznetsov (alexk) added a comment.Feb 25 2011, 7:47 AM

It seems to be Windows related problem. Apparently GHOST sometimes doesn't receive 'up' command from one of the three keys. I will try to fix it.

Ton Roosendaal (ton) added a comment.Feb 25 2011, 3:12 PM

Alexander: this would be very welcome. I heard from Nathan Letwory that the code here is quite complex though... windows seems to have weird methods for modifiers.

Alexander Kuznetsov (alexk) added a comment.Feb 26 2011, 6:47 AM

Found the problem. There is two possible solutions. Tomorrow I will test second one and compare and then I will send a patch. BTW, char for 'ascii' soon will be very limited for UTF8 & international keyboards.

Alexander Kuznetsov (alexk) added a comment.Feb 26 2011, 8:38 PM

I attached the patched.
PeekMessage 'ate' WM_SYSKEYDOWN & WM_SYSKEYUP messages which were in between WM_CHAR < WM_SYSDEADCHAR.
Dunno, removing messages is not really necessary as commands like WM_CHAR are skipped anyway.
I had idea to use ToAsciiEx, but then Blender never has proper Keyboard status.

Easier way to test this bug:
Open Task Manager
Right click on Blender
->Set Priority -> Low
-> Set Affinity -> to only one CPU
Try to press Ctrl + Shift + Alt simultaneously several times

Anyway keyMsg.wParam returns UTF-16. Ideally it should be converted into UTF 8 with 4 char array with WideCharToMultiByte, but GHOST messages do not support UTF8 yet. Therefore ascii should be clipped to be compatible with UTF-8.

Alexander Kuznetsov (alexk) attached 1 file(s): F14588: Fix_GHOST-Keys.patch.Feb 26 2011, 8:39 PM
Nathan Letwory (jesterking) added a comment.Feb 28 2011, 12:22 PM

Assigning to myself to review and commit.

Nathan Letwory (jesterking) added a comment.Mar 1 2011, 3:41 PM

Looks very much like this is essentially a duplicate of [#25476]. I'm as such marking this as duplicate, but will use the attached patch still from this one though.

Nathan Letwory (jesterking) added a comment.Mar 1 2011, 3:42 PM

(closing now as duplicate, will be changed to fixed when patch is in).

Nathan Letwory (jesterking) added a comment.Mar 1 2011, 4:20 PM

Applied patch from in r35283.

Nathan Letwory (jesterking) changed the task status from Unknown Status to Resolved.Mar 1 2011, 4:20 PM