Forums > MaxMSP

Simulating Pressing a Keyboard button.

May 10, 2007 | 3:17 pm


I’m currently using max/msp with a course at uni. The patch I’m working on at the moment, I’m trying to interface with a game through gestures. I’ve finished with the gesture recognition, but interfacing with the game is another matter.

The method I was hoping I could use was that you could somehow simulate pressing a key on the keyboard inside max. For example, if they made a gesture that was mapped to accelerate, it would ‘press’ the up key which would then be interpreted by the game as accelerate.

I was wondering if simulating keystrokes is possible at all, and if anyone can direct me in the right direction. If this isn’t, I’ll start looking down other paths.


May 11, 2007 | 9:03 am

Mac or Windows?

May 11, 2007 | 9:11 am

Sorry, I should have said.

It’s for windows.

May 11, 2007 | 11:32 am

I can’t work out how to edit… so I’ll double post.

I think I may have found the answer to my problem, I just need help implementing it.

Something about a java class called Robot, that simulates keypresses and mouse events.

I am guessing that I use the mxj object, any help on how to do this would be appreciated.

Viewing 4 posts - 1 through 4 (of 4 total)