BGE: Refer to keyboard event boolean problem
This appears to because the module will only be executed once. Variables assigned directly inside the module will retain their initial value and won't be re-evaluated when accessed later.

To re-evaluate a variable, define it inside a function and call the function from wherever you want to access the current value of the variable.

For example, in the module you might create a function to return True if the W key is pressed:

import bge

def is_w_active():
    return(bge.logic.KX_INPUT_ACTIVE == bge.logic.keyboard.events[bge.events.WKEY])


Then when this is called from a script (or anywhere else) like so:

import bge, keyboardmodule

print(keyboardmodule.is_w_active())


it will return True or False accordingly.