The problem isn't that it's a bug, is that it's not fully implemented for all keys. Fixing your table:

Code
1 Left mouse button
2 Either Ctrl key
4 Either Shift key
8 Either Alt key
16 Right mouse button
32 Middle mouse button
64 Right Shift key
128 Right Ctrl key
256 Right Alt key
512 CapsLock
1024 ScrlLock
2048 NumLock
???? Menu key


The 2 4 8 bitmasks have historically been "either-key", so 64 128 256 are simply layers on top to identify if the one on the right side has been pressed. Backwards compatibility would be broken if the 2 4 8 changes to be 'just the left one'.

The solution would be a 'feature request' to add bit masks for left-shift left-ctrl left-alt, because there's now to way to determine the difference between

left-only pressed
right-only pressed
both left+right pressed