Added a cast to keycodes for modifier matching