Replace hard coded use of oskey with a function. Add checks to avoid conflicting bindings with the OS.