nwillems: make a function called setKey that takes a key and a callback