Maybe key_w is a bool? I don't know. Or maybe it's not possible to get the address of engine variables..

You should indeed set it up in a function.

I don't understand why you can't use key_set..

void jumpEvent(){key_mapping.jump = TRUE;}
then use key_set to fire jumpEvent when a certain key is pressed.