As raidho says, usually a simple if-else is also fine, although in this case, it's perfectly viable since direction or direction, in normal usage, can never not be a number, so it will always work consistently, and how i intended it.
As for k and s, the relevant wiki entry for love.keypressed
explains, those are parameters that get filled when löve calls the function, similarly to how dt is passed in love.update by löve itself. k is for the representation of a key (called keyconstant on the wiki), while s represents the physical location of a key, based on the "standard" QWERTY keyboard (called scancode on the wiki, and elsewhere);
The difference is significant only if you realize that keyboards can differ from the "US-standard" QWERTY layout, e.g. i have a QWERTZ, french people may have AZERTY, and so on; If you press the 'Q' key on a QWERTY keyboard, both the keyconstant and scancode will be for the "q" letter, whereas if you press the 'Q' key on an AZERTY keyboard, the keyconstant will be "a", but the scancode will be "q".
If you're interested in how these callback functions get called, you can look at love.run
on the wiki.