Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-02-2010, 04:32 AM   #1
lrizzo
Member
lrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tongue
 
Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
merged terminal/launchpad/web server

[updated 06-dec]

At

http://info.iet.unipi.it/~luigi/kind...indle-terminal

you can find a standalone application that merges launchpad

https://www.mobileread.com/forums/showthread.php?t=97636

and my former ajaxterm code (and a web server), implementing the ideas described in

https://www.mobileread.com/forums/sho...7&postcount=26

At this stage the code is experimental and meant for developers only.
Extract the archive, look at the source and possibly rebuild it to make sure you don't have surprises (there is a precompiled binary if you trust it). Copy myts.arm and the two .ini files in a directory on the kindle and manually start the program in background.

The program acts as "launchpad". In particular, the "Shift"-t sequence enters terminal mode, from which you can exit pressing "Left<" (the "Page Back" key in the upper left). Keys act as their label, you can remap Esc, Ctrl and SYM to generate symbols not on the keyboard. Right now ESC is the "Left>" key, "Aa" acts as CTRL, and "Back" and shift can be used to generate characters not on alphanumeric keys. More details in the README file with the archive.

Right now the terminal uses a CP-437 font of size 8x16 from FreeBSD, which allows you to see 75 chars in vertical mode. ANSI emulation is almost complete though a few issues remain with autowrap mode and colors.

Also, the KindleDX keys might need some tweaks -- see keydefs.ini

Restart on a signal is known not to work.

Last edited by lrizzo; 12-06-2010 at 04:14 AM.
lrizzo is offline   Reply With Quote
Old 12-02-2010, 08:44 AM   #2
h1uke
Zealot
h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.
 
Posts: 121
Karma: 82565
Join Date: Aug 2010
Location: Maryland, USA
Device: dxg, k3w,k4nt,kpw
it is not clear if you are still using the browser/javascript.
If so, why can't your application simply talk to the telnet daemon
which comes with usbNetwork package?

A practical alternative for that may be mimicking the code from telnetd which
establishes a link to system shell.
h1uke is offline   Reply With Quote
Advert
Old 12-02-2010, 09:54 AM   #3
lrizzo
Member
lrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tongue
 
Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
Quote:
Originally Posted by h1uke View Post
it is not clear if you are still using the browser/javascript.
If so, why can't your application simply talk to the telnet daemon
which comes with usbNetwork package?

A practical alternative for that may be mimicking the code from telnetd which
establishes a link to system shell.
the browser is not involved. This application grabs keypresses in the same way as launchpad, and does the rendering using /dev/fb
It is trivial to disable the http server part if one does not want it. i just included it in the package as the code that does the virtual screen emulation is the same used in the ajaxterm clone.

There is no point in talking to the telnet daemon when you can talk directly to the pseudo-tty (see function term_new() in terminal.c).
The telnet daemon gives you nothing more than that, and instead adds another layer of encoding on the input and output streams.

cheers
luigi

Last edited by lrizzo; 12-02-2010 at 09:56 AM.
lrizzo is offline   Reply With Quote
Old 12-13-2010, 12:15 AM   #4
JDShaffer
Hobbit
JDShaffer began at the beginning.
 
JDShaffer's Avatar
 
Posts: 20
Karma: 10
Join Date: Jan 2007
Location: Shizuoka, Japan
Device: k2i
Awesome work! i finally managed to get it working on my K2i.

But I'm having trouble understanding the keyboard mapping.

How can I get the : key so I can escape VI?

Thanks,
Jeffrey
JDShaffer is offline   Reply With Quote
Old 12-13-2010, 08:26 AM   #5
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 3,455
Karma: 10484861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Great job.

You are featured on hackaday.com
http://hackaday.com/2010/12/10/kindl...ss-activation/
Congratulations.
kacir is offline   Reply With Quote
Advert
Old 12-17-2010, 09:25 PM   #6
janvanmaar
Addict
janvanmaar has a complete set of Star Wars action figures.janvanmaar has a complete set of Star Wars action figures.janvanmaar has a complete set of Star Wars action figures.janvanmaar has a complete set of Star Wars action figures.janvanmaar has a complete set of Star Wars action figures.
 
Posts: 219
Karma: 404
Join Date: Nov 2010
Device: Kindle 3G, Samsung SIII
The same problem here as JDShaffer had - the mapping of most special characters does not work. Only the Sym (physical Back) mapping works ( so I can type eg [] but not {} or () ). This is on Kindle3. I might have a closer look at the code later on...
janvanmaar is offline   Reply With Quote
Old 01-03-2011, 04:05 PM   #7
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,008
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by JDShaffer View Post
Awesome work! i finally managed to get it working on my K2i.

But I'm having trouble understanding the keyboard mapping.

How can I get the : key so I can escape VI?

Thanks,
Jeffrey
I press simulataneously the symbol key, the shift key and the k key (BackShiftK) to get the : I then type q! and press the enter key to exit vi. I also "export TERM=vt220" prior to invoking vi.
PoP is offline   Reply With Quote
Old 01-03-2011, 04:34 PM   #8
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,008
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by janvanmaar View Post
The same problem here as JDShaffer had - the mapping of most special characters does not work. Only the Sym (physical Back) mapping works ( so I can type eg [] but not {} or () ). This is on Kindle3. I might have a closer look at the code later on...
The symbols depicted in the Keyboard Mapping Window (displayed when running the terminal) are shown in 4 quadrants per key.

You can enter all symbols by pressing simultaneously the following keys to position you in their respective quadrant:

On the top row,
ALt+Shift+Letter Shift+Back+Letter
Alt+Letter Back+Letter

On the other two rows,
Shift+Letter Shift+Back+Letter
Letter Back+Letter

Hope this helps.
PoP is offline   Reply With Quote
Old 02-08-2011, 04:11 PM   #9
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,008
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by lrizzo View Post
[updated 06-dec]
...
At this stage the code is experimental and meant for developers only.
...
Thanks for your great application Luigi.

Whenever I enter an invalid hotkey (e.g. not present in the launchpad.ini file) the launchpad program reports the unknown sequence (see 3rd line in my console log below) but stops interpreting any further hotkey. The web server part still works at that point but I anyway have to kill and restart myts.arm manualy for the launchpad part to start reinterpreting hotkeys. Am I missing something.


74461.071 [execute_action 711] start terminal 1 got 0x4b160
74463.361 [curterm_end 822] exit from terminal mode
74476.161 [call_hotkey 809] Unknown hotkey sequence entered len 1:
PoP is offline   Reply With Quote
Old 02-08-2011, 05:37 PM   #10
janvanmaar
Addict
janvanmaar has a complete set of Star Wars action figures.janvanmaar has a complete set of Star Wars action figures.janvanmaar has a complete set of Star Wars action figures.janvanmaar has a complete set of Star Wars action figures.janvanmaar has a complete set of Star Wars action figures.
 
Posts: 219
Karma: 404
Join Date: Nov 2010
Device: Kindle 3G, Samsung SIII
I get it know - it works. Thanks, PoP!
janvanmaar is offline   Reply With Quote
Old 02-09-2011, 12:30 PM   #11
lrizzo
Member
lrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tongue
 
Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
Quote:
Originally Posted by PoP View Post
Thanks for your great application Luigi.

Whenever I enter an invalid hotkey (e.g. not present in the launchpad.ini file) the launchpad program reports the unknown sequence (see 3rd line in my console log below) but stops interpreting any further hotkey. The web server part still works at that point but I anyway have to kill and restart myts.arm manualy for the launchpad part to start reinterpreting hotkeys. Am I missing something.


74461.071 [execute_action 711] start terminal 1 got 0x4b160
74463.361 [curterm_end 822] exit from terminal mode
74476.161 [call_hotkey 809] Unknown hotkey sequence entered len 1:
i have seen myts.arm stop parsing sequences, but have not investigated
the bug in detail. Your analysis is very interesting, let me try to replicate
the bug and see if we can fix it.

thanks
luigi
lrizzo is offline   Reply With Quote
Old 02-10-2011, 06:06 PM   #12
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,008
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by lrizzo View Post
[updated 06-dec]
...
Right now the terminal uses a CP-437 font of size 8x16 from FreeBSD, which allows you to see 75 chars in vertical mode.
...
Luigi, just FYI. I came across this fixedc.fon CP437 6x13 font at http://www.chiark.greenend.org.uk/~sgtatham/fonts/ it is a (small but readable) font you might want to consider for 80 columns terminal display in Kindle Portrait mode.
PoP is offline   Reply With Quote
Old 02-14-2011, 01:33 AM   #13
lynus
Junior Member
lynus began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2011
Device: kindle 3
hi,thanks for your great job.
i came across a problem:when i press <Alt>+<Shift>+u,in order to input &,and the screan came out &*,two symbols.
and i press <Alt>+<Shift>+i,the result is &*,too.
any solution?
lynus is offline   Reply With Quote
Old 02-14-2011, 08:27 AM   #14
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,008
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by lynus View Post
hi,thanks for your great job.
i came across a problem:when i press <Alt>+<Shift>+u,in order to input &,and the screan came out &*,two symbols.
and i press <Alt>+<Shift>+i,the result is &*,too.
any solution?
I concur. Till the bug gets fixed my bypass solution would be to generate the two symbols &* and DELete the one we don't intend.
PoP is offline   Reply With Quote
Old 02-14-2011, 10:54 AM   #15
h1uke
Zealot
h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.
 
Posts: 121
Karma: 82565
Join Date: Aug 2010
Location: Maryland, USA
Device: dxg, k3w,k4nt,kpw
Quote:
Originally Posted by PoP View Post
Till the bug gets fixed
unfortunately, that's not a software bug, but a design flaw.
The "Alt" keyboard key behaves in a special way.
While all other keys generate usual linux "press" and "release"
input message, this key doesn't generate anything when used alone.
If used in a combination with the most other keys -- doesn't matter sequentially
or simultaneously -- four input events are generated:
  • "Alt" pressed
  • "key" pressed
  • "key" released
  • "Alt" released

But, the upper row keys, i.e. QWERTYUIOP combined with the "Alt"
do non produce Alt/ event sequences like shown above,
they simulate numbers instead. For example, pressing and releasing Alt/Q causes
the following input messages to be generated:
  • "1" pressed
  • "1" released

So, by design it is not possible to enter the Alt/Q .. Alt/P sequences from
the Kindle keyboard. This is true at least for K3W and KDXG models.
h1uke is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP+Apache web server for calibre ... chaley Related Tools 254 04-28-2014 08:18 PM
Running Calibre on Terminal Server JeffAlan66 Calibre 2 08-12-2010 02:00 PM
Web Content Server mezme Calibre 7 01-08-2010 09:59 PM
Calibre - web server problems eclpmb Calibre 9 11-28-2008 02:04 PM


All times are GMT -4. The time now is 08:24 PM.


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