Trying to make a little app that saves all the characters that i type

Hey guys, howre you?

I wanted to create something that can save all the characters that i type on my computer. I think is not that difficult, but i am kind of new with all this, so i dont know how to do it. Anyone that has an idea can help me? Thanks a lot.

1 Like
String txt = "";
void setup() {
  size(600,600);
  textAlign(3,3);
  textSize(20);
}
void draw() {
  background(0);
  text(txt,width/2,height/2);
}
void keyPressed() { txt += key; }

it is an unfiltered version. I will reply with the filtered (it won’t show the weird characters) in a few minutes

1 Like

here is a program that only allows characters in the char acceptable[] = ("here").toCharArray();

char acceptable[] = ("aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ ").toCharArray();
String txt = "";
void setup() {
  size(600, 600);
  textAlign(3, 3);
  textSize(20);
}
void draw() {
  background(0);
  text(txt, width/2, height/2);
}
void keyPressed() { 
  for (int i = 0; i < acceptable.length; i++) if (key == acceptable[i]) txt += key;
  if (keyCode == BACKSPACE) txt = removeLast(txt);
}
String removeLast(String input) {
  String output = "";
  for (int i = 0; i < input.length()-1; i++) {
    output += input.charAt(i);
  }
  return output;
}

others are ignored.

2 Likes

This is great, i will try it now. Thank you so much!

2 Likes

glad to help : P

have a nice day!

1 Like

is it actually saved?

no, i couldnt save it, but its a good start

1 Like

You can always create a .txt file with the text

1 Like

Look at saveStrings for that

2 Likes

great! thanks. And… is it possible to do that the app continue working while im for example at google? so it can save all the things i type

1 Like

it is possible, however, you would need java libraries for that. (I don’t know how to use them btw).

If you really want to get it done quick, you can just download a safe key-logger. It is a program running in the background and records user input. It can be used to steal credit card information or passwords to any important website, so be careful while you are using it. And don’t forget to get the users consent if another person is using the same computer.

Just so you know, something like

void setup() {} void draw() {}
public void keyPressed() {
  println(key);
}

doesn’t work.

1 Like

Also for a simpler version of acceptable input use something like

void keyTyped() {
   <here>
}

it ignores shift, ctrl, capslock, numlock,…

1 Like

yes i thought about that but i dont know any and im afraid of someone stealing my info, do you recomend any?

1 Like

nope : P I have no idea. I have never done anything like it. Please do some research before downloading any potential malware. Sorry.

Yes i will! thanks so much for all the info, stay well

1 Like

AutoHotKey might be worth a look. It’s macro-making tool so it’s designed for capturing user input already. I have never tried to save the captured data with it before but I imagine it is possible.

1 Like

see Simple key stroke recorder - Scripts and Functions - AutoHotkey Community

see Simple key stroke recorder - Scripts and Functions - AutoHotkey Community

key logging in itself is seen as problematic (not your intention, I know) because on a public computer you can log passwords too

Chrisir

1 Like

thanks for that! is it save? how can a make it run? im traying to make a project to see all the worlds that i type for some month and then print it only, but im afraid somebody still my info so i want to make it safe. I saw the code in autohotkey but how can i make it work? thanks again!

  • download autohotkey AHK
  • use code in AHK
  • when you type a password disable AHK before
  • I never tried it, so make some experiments
2 Likes

Thank you so much for all this info and your hel, i will try it. Stay well

2 Likes