The code example in the InputObject.KeyCode article contains smart quotation marks in the place of actual quotation marks on lines 2, 20 and 23. The example would error if ran.
The issue can be remediated by replacing the smart quotes with actual quotes, note: “”
with ""
.