Previously we saw (if you saw) how logic bricks works and I hope you gave some tries with it. Now we're going to move an object with logic bricks when a key (any key you want) in the keyboard is pressed.
Select the object on which you want the mechanism to happen and add a keyboard sensor (i selected the default Blender cube and added a sensor coz i wanted the cube to move), press the empty field near the Key: you'll see it gets highlight in blue color (depends on what theme you're using. I'm using the default UPBGE 2.6+ theme) saying Press a key. It's waiting for the user to press a key so whenever the user presses that certain key, this keyboard sensors is triggered. Press a key now if you haven't yet lol. And it should something like this.
Add an And controller and connect the sensor you added previously with the controller you just added. Now added a Motion actuator and connect it to the controller. On Loc: (which means Location) you'll be seeing X: 0.00 | Y: 0.00 | Z: 0.00 Click on Y (you can click on whatever axis you like, for now I'm sticking with Y as W is used to move a character on Y axis i.e., front) and change value to 0.20 or something you want.
Press P the game engine runs. Press W and the object moves!
Now change values on Rot: (which means Rotation) and Press P to run the game. Your object now moves and rotates.
If you don't like the way the object moves and rotates, Press the L to deactivate it. And now try running the game. This happens when the object moves in local axis. When the cube is rotated 45deg in X axis, the cube moves in the axis it is faced on the Y axis when it is moved in that axis.