Find key stroke with dijkstra.