Max keylogger

nanonash's icon

Hello , I'm back on this list after 2 years of inactivity!

I'd like to implement a keylogger using Max (something that captures any
pressed key even if the Max window is not on top).

Is there a way to do this using household objects ? or is Java/C code needed
?

I've heard about the external ice.key that does just that but it's not free
and I'm not ready to spend money on 0's and 1's..

Thanks for your help,

GP

Peter Castine's icon

On 5-Dec-2006, at 5:00, william potage wrote:

> I'd like to implement a keylogger using Max (something that
> captures any pressed key even if the Max window is not on top).

ice.key from iCE tools does this. (URI below)

> Is there a way to do this using household objects ? or is Java/C
> code needed ?

ice.key uses some pretty low-level C. I doubt that Java would let
you go that deep and dirty. The standard key object & friends only
get keystrokes from the main Max event loop and have no way
whatsoever of accessing keystrokes when in the backround

-------------- http://www.bek.no/~pcastine/Litter/ -------------
Peter Castine +--> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

f.e's icon

Peter Castine wrote:
> Is there a way to do this using household objects ? or is Java/C code
> needed ?
>
> ice.key uses some pretty low-level C. I doubt that Java would let you
> go that deep and dirty.
Right. Doing this in Java *is* a nightmare. Glad you've made it in C,
'cause it's not easy too ;-)

f.e
--
f.e chanfrault | aka | personal computer music
> >>>>>> http://www.personal-computer-music.com
> >>>>>> |sublime music for a desperate people|

i.m.klif's icon

On Dec 5, 2006, at 5:00 AM, william potage wrote:

> Hello , I'm back on this list after 2 years of inactivity!
>
> I'd like to implement a keylogger using Max (something that
> captures any pressed key even if the Max window is not on top).
>
> Is there a way to do this using household objects ? or is Java/C
> code needed ?

Apparently, Hi can do this. Select keyboard as input, map the
keycodes (or whatever Hi is outputting) to ASCII, and you're good to go.

I just briefly tested this using hi.help and max runtime (don't have
license on this machine), but it does seem to work across the system
(including system password dialogs!)

klif

PhiDjee's icon

Hi,

Please, could you post the link to this ASCII ?
I can't find it.

Thanks,
Philippe

i.m.klif's icon

> ,
>
> Please, could you post the link to this ASCII ?
> I can't find it.

Hm, I don't have max installed at hand so i can't make example patch,
but you need to map Hi output values of each key to appropriate ascii
codes.

you could do mapping using hi, coll and key objects. hi object's
output will be coll adress and key object's ascii code output will be
coll value. at the same time use itoa to check if the ascii value
matches the actual keypress. when you press all the keys on a
keyboard, you have your map. you could also map the output of hi
directly to the ascii character that comes out of itoa object.

Things will get more complicated with double/triple keypresses using
shift, option or both. Hi doesn't care for shift or option,it only
outputs two keypresses at the same time. If you want capital letters
to map, you would have to keep track of whether shift or option are
pressed and for how long. It could get quite complex, but for basic
text it should be fairly easy.

see info for key and itoa objects. that should get you started.

klif

PhiDjee's icon

Hi klif,

Thank you very much!
I thought first you were using the ASCII object.
(was in a ftp repertory at Ircam...)
No problem to deal with standard Max objects.

Thanks again,
Philippe

jbm's icon

I had been wondering about this last year sometime, when I wanted to keep track of a user's activity in another app -- does anybody know how to get the name of the front-most app? This would make it possible to have Max respond to key-commands in certain ways depending on which app is in the foreground... Could be handy.

J.

PhiDjee's icon

If you're on Mac, that sounds a good job for AppleScript.

Bye

magic magic's icon

you need to map Hi output values of each key to appropriate ascii codes.
Keylogger is effective and does the job without costing you a penny. It has a variety of uses for example letting you have a record of your typing so if you lose a document you still have the text. The makers also provide free upgrades for life. Overall worth a try. This is the best keylogger software https://www.elitekeyloggers.com/elite-keylogger-mac I've ever used.