graph.c - key handler is now a global variable