Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-12-2012, 02:17 PM   #46
wandermaybe
Junior Member
wandermaybe began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2012
Device: kindle DXG
Am I understanding this correctly...
this requires no hacks or mods to the eReader... and no cords?

Simply
install and run Python and wxPython on a Wifi-operating computer... allow Python through any firewall... and enter the url on the eReader's browser?

Seems so easy and simple - no obscure hacking or wisdom needed!

The result is that the eReader will mirror the computer display? (includes the mouse movement?)

Last edited by wandermaybe; 05-12-2012 at 03:58 PM.
wandermaybe is offline   Reply With Quote
Old 05-13-2012, 06:08 PM   #47
jmseight
Zealot
jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'
 
Posts: 130
Karma: 10000
Join Date: Mar 2012
Device: Kindle 3G, Kindle Touch 3G, iRiver Story HD, Sony Reader
Hi,

No modification to the Kindle. The python script runs on the PC and saves the screen image into a file and serves it as a webpage. Simply go to the PC URL and it shows the image (of the screen).

There are no mouse or keyboard - the ebook screen only show a picture of the PC screen.

Thanks,
James
jmseight is offline   Reply With Quote
Old 05-13-2012, 06:49 PM   #48
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,066
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
I have a new dither routine that does not use dither tables. You can see it in the gmplay program used in the "geekmaster kindle video" thread:

http://www.mobileread.com/forums/sho...d.php?t=177455

Click the "Magic Revealed" button to see the source code.

You might want to try that to see if it runs faster (or slower ).
geekmaster is offline   Reply With Quote
Old 05-29-2012, 11:03 AM   #49
Armegalo
Junior Member
Armegalo began at the beginning.
 
Posts: 4
Karma: 20
Join Date: May 2012
Device: Amazon Kindle
Hmm... no matter what I do I can't get a refresh faster than every 6 seconds.
I compressed the jpg in the original code to 0
I've tried all your codes @jmseight
Nothing will get below (or above) 6 seconds... am I being thick?

Oh and does anyone know how to get it to pick up the mouse pointer in the screen capture... doesn't seem to do that at all...
Armegalo is offline   Reply With Quote
Old 06-09-2012, 10:56 AM   #50
w126
Junior Member
w126 began at the beginning.
 
Posts: 9
Karma: 42
Join Date: May 2010
Device: Kindle Paperwhite (2013), Onyx Boox M92, Kindle 2
Quote:
Originally Posted by Armegalo View Post
Hmm... no matter what I do I can't get a refresh faster than every 6 seconds.
It may be a problem with reverse name lookup inside BaseHTTPRequestHandler.send_response() method. It was in my case, at least. Try adding the following code to serv class:
Code:
  def address_string(self):
    host, port = self.client_address[:2]
    #return socket.getfqdn(host)
    return host
I've found this solution here: http://stackoverflow.com/questions/2...r-on-localhost
w126 is offline   Reply With Quote
Old 06-15-2012, 09:30 AM   #51
Armegalo
Junior Member
Armegalo began at the beginning.
 
Posts: 4
Karma: 20
Join Date: May 2012
Device: Amazon Kindle
Fantastic - down to about 1 second updates now. I have eye strain from looking at my monitor, but suddenly, I can use my kindle to work ) how cool is that!

Thank you all

Last thing I need is a way to capture the mouse pointer at the same time...
any ideas anyone?
Armegalo is offline   Reply With Quote
Old 06-15-2012, 10:46 AM   #52
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,066
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by Armegalo View Post
Fantastic - down to about 1 second updates now. I have eye strain from looking at my monitor, but suddenly, I can use my kindle to work ) how cool is that!

Thank you all

Last thing I need is a way to capture the mouse pointer at the same time...
any ideas anyone?
The mouse pointer is usually handled inside the video device driver, and not in the framebuffer. I have seen code to make the system calls needed at codeproject.com, as I recall. Try looking there (hopefully their site search engine works better than trying to search mobileread.

Some device drivers MAY put the mouse cursor in the framebuffer. Also, some video modes may do it too. Try changing your video accelleration settings (to the lowest settings). That might do it, but it will make other stuff run slower...
geekmaster is offline   Reply With Quote
Old 06-15-2012, 10:51 AM   #53
knc1
Embedded Cheerleader
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 5,780
Karma: 5722276
Join Date: Feb 2012
Device: Too many.
Quote:
Originally Posted by Armegalo

Last thing I need is a way to capture the mouse pointer at the same time...
any ideas anyone?
I think the tool for that in frame buffer devices is gpm:
http://www.nico.schottelius.org/software/gpm/

If not already on the Kindle, pull it out of a Debian armel package and give it a try.
That HowTo is indexed.

Note: Not sure it will work, it may have to ported or extended for the Kindle hardware.
knc1 is offline   Reply With Quote
Old 06-15-2012, 11:30 AM   #54
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,066
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by knc1 View Post
I think the tool for that in frame buffer devices is gpm:
http://www.nico.schottelius.org/software/gpm/

If not already on the Kindle, pull it out of a Debian armel package and give it a try.
That HowTo is indexed.

Note: Not sure it will work, it may have to ported or extended for the Kindle hardware.
He was talking about the mouse pointer on the host PC (probably a windows box, hence the codeproject reference). By framebuffer, I meant "video RAM" (real or virtual).
geekmaster is offline   Reply With Quote
Old 06-15-2012, 01:02 PM   #55
knc1
Embedded Cheerleader
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 5,780
Karma: 5722276
Join Date: Feb 2012
Device: Too many.
Quote:
Originally Posted by geekmaster View Post
He was talking about the mouse pointer on the host PC (probably a windows box, hence the codeproject reference). By framebuffer, I meant "video RAM" (real or virtual).
Same solution, different arch. Run it inside of the VM if the VM isn't doing the mouse capture already.
knc1 is offline   Reply With Quote
Old 06-16-2012, 01:51 PM   #56
Armegalo
Junior Member
Armegalo began at the beginning.
 
Posts: 4
Karma: 20
Join Date: May 2012
Device: Amazon Kindle
Eek, I wouldn't know how to run it in the VM.
Nah, turning off the hardware accel didn't do much, but thanks for the suggestion.
And yep, it's a windows box (xp).
I'm brand new to python so still finding my way. One thing I thought was perhaps I could just draw a new pointer on top of the image after it's been captured.
Haven't had much luck so far - can't even get the bloody thing to tell me where the mouse actually is...

Code:
mouse=wx.MouseEvent()
mouse_pos=mouse.GetLogicalPosition(context)
print "Mouse ="+str(mouse_pos.x)+","+str(mouse_pos.y)
I get that "context" is probably the wrong thing to pass to the MouseEvent class but what should it be?

Last edited by Armegalo; 06-16-2012 at 02:01 PM.
Armegalo is offline   Reply With Quote
Old 06-16-2012, 02:09 PM   #57
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,066
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by Armegalo View Post
Eek, I wouldn't know how to run it in the VM.
Nah, turning off the hardware accel didn't do much, but thanks for the suggestion.
And yep, it's a windows box (xp).
I'm brand new to python so still finding my way. One thing I thought was perhaps I could just draw a new pointer on top of the image after it's been captured.
Haven't had much luck so far - can't even get the bloody thing to tell me where the mouse actually is...

Code:
mouse=wx.MouseEvent()
mouse_pos=mouse.GetLogicalPosition(context)
print "Mouse ="+str(mouse_pos.x)+","+str(mouse_pos.y)
I get that "context" is probably the wrong thing to pass to the MouseEvent class but what should it be?
Okay, I searched codeproject.com for you. Here is the first link I found (Capturing the Desktop Screen with the Mouse Cursor Image): http://www.codeproject.com/Articles/...e-Mouse-Cursor

Although that project uses C#, you should be able to adapt it to C by using the same Win32api calls that it makes. Or find a different project.

To download source from codeproject, you may need a free login account. Code Project downloads typically use a COPL license (which is much like MIT or BSD, allowing commercial use).

EDIT: Okay, this shows a variety of ways to capture the screen in C (some with mouse pointer):
http://www.codeproject.com/Articles/...ing-the-screen
This one is LGPL, so for commercial use you would have to wrap it in a DLL.

Last edited by geekmaster; 06-16-2012 at 02:20 PM.
geekmaster is offline   Reply With Quote
Old 06-18-2012, 01:44 PM   #58
w126
Junior Member
w126 began at the beginning.
 
Posts: 9
Karma: 42
Join Date: May 2010
Device: Kindle Paperwhite (2013), Onyx Boox M92, Kindle 2
Here is quick and dirty fragment of code that adds mouse cursor:
Code:
      ...
      memory.Blit(0, 0, w, h, context, l, t)
# start of inserted code
      pos=wx.GetMousePosition()
      (cw,ch)=memory.GetTextExtent('x')
      memory.DrawText('x',pos.x-cw/2, pos.y-ch/2)
# end of inserted code
      memory.SelectObject(wx.NullBitmap)
      ...
It draws 'x' letter instead of actual cursor image.
However, because of the delay (around 1 second) it's inconvenient to use it for pointing and clicking items if you only look at the reader screen. I'm thinking about adding a mouse cursor in the HTML page and quicker updates of its position, independent of screen image updates (new positions could be retrieved with AJAX requests).
w126 is offline   Reply With Quote
Old 06-18-2012, 08:24 PM   #59
Armegalo
Junior Member
Armegalo began at the beginning.
 
Posts: 4
Karma: 20
Join Date: May 2012
Device: Amazon Kindle
:D

Thanks for the thought Geekmaster, but I'm equally new to C, so I'll stick to python for now.

Fantastic W126 - didn't realise getting the mouse pos was that easy!

I like the idea of speeding up the mouse refresh rate, that makes a lot of sense. Originally, I was planning to pan the screen around with the mouse. I know this will be incompatible with your idea, but for those wanting a bigger desktop, here's the code to insert...

Code:
      memory.SelectObject(bitmap)

#    beginning of inserted code

      offsetx=0
      offsety=0

      pos=wx.GetMousePosition()
     
      if pos.x>w/2:
        offsetx+=pos.x-w/2

      if pos.x>screenw-w/2:
        offsetx=screenw-w

      if pos.y>h/2:
        offsety+=pos.y-h/2

      if pos.y>screenh-h/2:
        offsety=screenh-h

      
      memory.Blit(0, 0, w, h, context, offsetx, offsety)
      
      (cw,ch)=memory.GetTextExtent('>X<')
      memory.DrawText('>X<',(pos.x-cw/2)-offsetx, (pos.y-ch/2)-offsety)
      
#    end of inserted code

      memory.SelectObject(wx.NullBitmap)
You'll also need to add the following above it...

Code:
w,h=(706,600)

# beginning of inserted code

# your actual monitor resolution
screenw,screenh=(1280,720)

# end of inserted code

#width and height of capture region
Admittedly, it's more than a little clunky like that but if you need a bigger screen, or even to get those few pixels to the right that can't be shown on an 800x600 screen.

Nice!
Armegalo is offline   Reply With Quote
Old 07-20-2012, 04:27 PM   #60
1094Jacob
Amateur Radio General
1094Jacob ought to be getting tired of karma fortunes by now.1094Jacob ought to be getting tired of karma fortunes by now.1094Jacob ought to be getting tired of karma fortunes by now.1094Jacob ought to be getting tired of karma fortunes by now.1094Jacob ought to be getting tired of karma fortunes by now.1094Jacob ought to be getting tired of karma fortunes by now.1094Jacob ought to be getting tired of karma fortunes by now.1094Jacob ought to be getting tired of karma fortunes by now.1094Jacob ought to be getting tired of karma fortunes by now.1094Jacob ought to be getting tired of karma fortunes by now.1094Jacob ought to be getting tired of karma fortunes by now.
 
1094Jacob's Avatar
 
Posts: 4
Karma: 494132
Join Date: Jul 2012
Location: Missouri, US
Device: Kindle Keyboard Wi-Fi
Could somebody please edit the code to make it show the image in color?
1094Jacob is offline   Reply With Quote
Reply

Tags
display, emonitor, kindle, screen

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump


All times are GMT -4. The time now is 07:37 PM.


MobileRead.com is a privately owned, operated and funded community.