Author Topic: automatic password on mobile phone  (Read 3711 times)

T3g+D3$ign

  • Newbie
  • *
  • Posts: 6
automatic password on mobile phone
« on: June 13, 2017, 11:25:07 am »
I use the Digispark to automatically login to an account on my PC, but when I use the same code on my phone it does not work.
I do not know why it does not work on a phone, but I have the idea that the enter/tab section of the code is the problem. Please help me with this problem.

Code: [Select]
#include "DigiKeyboard.h"

void setup() {
  DigiKeyboard.update();
  DigiKeyboard.delay(2000);
  DigiKeyboard.print("username");
  DigiKeyboard.sendKeyStroke(43);
  DigiKeyboard.println("password");
}

void loop() {

}

KASA

  • Newbie
  • *
  • Posts: 34
Re: automatic password on mobile phone
« Reply #1 on: June 14, 2017, 02:48:33 am »
(1) Which phone?
(2) does entering stuff without pressing enter work?

T3g+D3$ign

  • Newbie
  • *
  • Posts: 6
Re: automatic password on mobile phone
« Reply #2 on: June 14, 2017, 12:45:08 pm »
I have a Samsung galaxy s4 and without pressing enter it does not work.

KASA

  • Newbie
  • *
  • Posts: 34
Re: automatic password on mobile phone
« Reply #3 on: June 14, 2017, 02:31:44 pm »
So no character appear if you plug your Spark into the phone? why do you think that the enter key is the problem then? Obviously entering stuff doesn't work at all then... Do you use an OTG Cable?

T3g+D3$ign

  • Newbie
  • *
  • Posts: 6
Re: automatic password on mobile phone
« Reply #4 on: June 15, 2017, 06:32:21 am »
Yes, I am using an otg cable and there are characters appearing on the screen but not all of them. When I tell to fill the username in and the password. It fills 'sername' and 'password' in. I don't know why I thought the enter button was the problem because it isn't the problem.

KASA

  • Newbie
  • *
  • Posts: 34
Re: automatic password on mobile phone
« Reply #5 on: June 15, 2017, 07:50:58 am »
Try making the delay at the start longer and add some delay between the next steps like this:

Code: [Select]
#include "DigiKeyboard.h"

void setup() {
  DigiKeyboard.update();
  DigiKeyboard.delay(3000);
  DigiKeyboard.print("username");
  DigiKeyboard.delay(100);
  DigiKeyboard.sendKeyStroke(43);
  DigiKeyboard.delay(100);
  DigiKeyboard.println("password");
}

void loop() {

}

T3g+D3$ign

  • Newbie
  • *
  • Posts: 6
Re: automatic password on mobile phone
« Reply #6 on: June 15, 2017, 08:24:30 am »
thank you. this helps. the problem no is that when I plug it into my computer it works but on my mobile phone not. The username is the same, so it can't be that the library for the phone keyboard is different. so what could be the problem?

KASA

  • Newbie
  • *
  • Posts: 34
Re: automatic password on mobile phone
« Reply #7 on: June 16, 2017, 01:08:45 pm »
What happens if you plug it into your phone?
Does the digispark enter the username?
what happens next?