Thank You for the reply, after some attempts now im pretty sure the problem is on the miniUSB socket.
When i put pressure on the keyboard, the cable connector somehow shifts inside the socket and maybe one pin lose contact or causes issues on the keyboard controller who send to windows the sleep mode input.
Now i temporarily resolved removing the cover and tooking out the little pcb:
Show Image
(http://i.imgur.com/B14oZ91.jpg?1)
It works because the connection is stable by any little movement
You are right, if a solder a vable it could come straight off.
I have some of those:
Show Image
(http://i00.i.aliimg.com/img/pb/506/779/474/474779506_834.JPG)
I could solder itbut i have to find a place to "fit" it on the keyboard..
That looks like a standard USB A socket. You'd be better to find a replacement mini USB socket so that existing cables will still work.