Added canKeysLock and canKeysUnlock hooks and ply:canKeysLock ply:canKeysUnlock functions. Fixes #1320