Alter the single modifier code to use device independent key masks as opposed to key codes

Fixes #1712
add brackets round ternary operator
Use @() for NSNumber creation
Merge pull request #1723 from quicksilver/1712

Alter the single modifier code to use device independent key masks as opposed to key codes