|
|
#1 |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Apr 2014
Device: kindle 4 black
|
Sorry for my poor English.
Although I have a holder to hold my k4, I still have to put my hand on page down button,which makes me unconfortable.So I have an idea:How about using mobile phone to control k4 keyborad? Code:
#include <unistd.h>
#include <time.h>
#include <stdio.h>
#include <linux/input.h>
#include <fcntl.h>
//#include "input.h"
#define EV_NONE 0
#define EV_PRESS 1
void put_kbd(int fd,unsigned short key)
{
struct input_event iev;
iev.type = 0x04;
iev.code = 0x04;
iev.value= EV_PRESS;
gettimeofday(&iev.time,NULL);
write(fd,&iev,sizeof(iev));
iev.type = 0x01;
iev.code = key;
iev.value= EV_PRESS;
gettimeofday(&iev.time,NULL);
write(fd,&iev,sizeof(iev));
iev.type = 0x00;
iev.code = 0x00;
iev.value= EV_NONE;
gettimeofday(&iev.time,NULL);
write(fd,&iev,sizeof(iev));
}
void put_fw(int fd,unsigned short key)
{
struct input_event iev;
iev.type = 0x01;
iev.code = key;
iev.value= EV_PRESS;
gettimeofday(&iev.time,NULL);
write(fd,&iev,sizeof(iev));
iev.value= EV_NONE;
gettimeofday(&iev.time,NULL);
write(fd,&iev,sizeof(iev));
}
int main(int argc, char* argv[])
{
int fd_kbd,fd_fw;
int key;
if((fd_kbd = open("/dev/input/event0",O_RDWR))<-1)
{
printf("error open keyboard\n");
return -1;
}
if( (fd_fw = open("/dev/input/event1",O_RDWR))<-1)
{
printf("error open keyboard_fw\n");
return -1;
}
printf("Start remote control.\n");
while(scanf("%d",&key)!=-1 && key > 0 && key < 255)
{
put_fw(fd_fw,key);
put_kbd(fd_kbd,key);
}
if(fd_fw>-1)
{
close(fd_fw);
}
if(fd_kbd>-1)
{
close(fd_kbd);
}
printf("Exit.\n");
return 0;
}
but I want to use mobile phone to control k4,and I don't know how to write an android application to control k4 through ssh? |
|
|
|
|
|
#2 |
|
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Someone already did this, here: https://www.mobileread.com/forums/showthread.php?t=203479
It grants control of your Kindle through the browser. Last edited by eschwartz; 05-09-2014 at 03:43 AM. |
|
|
|
| Advert | |
|
|
|
|
#3 | |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Apr 2014
Device: kindle 4 black
|
Quote:
|
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remote X11? | timb.us | Kindle Developer's Corner | 74 | 04-21-2013 12:23 AM |
| HD Fire HD Keyboard and Bluetooth Keyboard? | Doc109 | Amazon Fire | 18 | 01-29-2013 10:54 AM |
| Keyboard entry when no keyboard is displaying | geneven1 | enTourage eDGe | 5 | 06-14-2011 07:07 AM |
| Your vote - keyboard or no keyboard on Kindle | mrzerga | Amazon Kindle | 56 | 03-10-2011 08:22 PM |
| Accessories Remote | Kumabjorn | Amazon Kindle | 20 | 07-19-2010 05:30 PM |