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

**URL:** <https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704>\
**Category:** Coding Questions\
**Created:** [February 10, 2021, 3:10pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704 "2021-02-10T15:10:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://discourse.processing.org/u/denis)\
**Post date:** [February 10, 2021, 3:10pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/1 "2021-02-10T15:10:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [February 10, 2021, 3:55pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/2 "2021-02-10T15:55:12Z")

</div>

```auto
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

---

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [February 10, 2021, 4:03pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/3 "2021-02-10T16:03:18Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://discourse.processing.org/u/denis)\
**Post date:** [February 10, 2021, 5:01pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/4 "2021-02-10T17:01:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [February 10, 2021, 5:08pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/5 "2021-02-10T17:08:37Z")

</div>

glad to help : P

have a nice day!

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 10, 2021, 7:11pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/6 "2021-02-10T19:11:30Z")

</div>

is it actually saved?

---

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://discourse.processing.org/u/denis)\
**Post date:** [February 10, 2021, 7:53pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/7 "2021-02-10T19:53:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [February 10, 2021, 8:00pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/8 "2021-02-10T20:00:53Z")

</div>

You can always create a .txt file with the text

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 10, 2021, 9:24pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/9 "2021-02-10T21:24:47Z")

</div>

Look at saveStrings for that

---

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://discourse.processing.org/u/denis)\
**Post date:** [February 10, 2021, 9:34pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/10 "2021-02-10T21:34:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [February 11, 2021, 3:26pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/11 "2021-02-11T15:26:23Z")

</div>

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

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

```

doesn’t work.

---

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [February 11, 2021, 4:07pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/12 "2021-02-11T16:07:53Z")

</div>

Also for a simpler version of acceptable input use something like

```auto
void keyTyped() {
   <here>
}

```

it ignores shift, ctrl, capslock, numlock,…

---

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://discourse.processing.org/u/denis)\
**Post date:** [February 11, 2021, 7:43pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/13 "2021-02-11T19:43:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [February 11, 2021, 7:52pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/14 "2021-02-11T19:52:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://discourse.processing.org/u/denis)\
**Post date:** [February 11, 2021, 7:53pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/15 "2021-02-11T19:53:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![OMG](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/omg/32/12073_2.png) [@OMG](https://discourse.processing.org/u/OMG)\
**Post date:** [February 12, 2021, 4:49am UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/16 "2021-02-12T04:49:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 12, 2021, 8:42pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/17 "2021-02-12T20:42:51Z")

</div>

> [@OMG](#):
>
> AutoHotKey

see [Simple key stroke recorder - Scripts and Functions - AutoHotkey Community](https://autohotkey.com/board/topic/30294-simple-key-stroke-recorder/)

see [Simple key stroke recorder - Scripts and Functions - AutoHotkey Community](https://autohotkey.com/board/topic/30294-simple-key-stroke-recorder/)

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

Chrisir

---

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://discourse.processing.org/u/denis)\
**Post date:** [February 17, 2021, 3:12pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/18 "2021-02-17T15:12:54Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 17, 2021, 6:40pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/19 "2021-02-17T18:40:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://discourse.processing.org/u/denis)\
**Post date:** [February 18, 2021, 1:46pm UTC](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704/20 "2021-02-18T13:46:50Z")

</div>

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

[Next page](https://discourse.processing.org/t/trying-to-make-a-little-app-that-saves-all-the-characters-that-i-type/27704.md?page=2)
