Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-11-2013, 11:12 AM   #1
jtt
Connoisseur
jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.
 
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
vim for PocketBook 622 and 623

Hi,

as I already mentioned in another thread I considered writing a program that allows to use the vi or vim editor on PocketBooks with a touch screen. This project now has reached a stage where I hope it might also be of interest to other people.

The package consists of two parts. On the one hand there's a slightly modified version of the most recent release (7.4) of vim (the vi program already installed on the PocketBook unfortuntely is too crippled to be of any use). One the other hand there's the vip.app apllication that interfaces with the editor and takes care of displaying what you edit. For principle reasons this set-up can only work on devices where pseudoterminals can be used!

When the program is running the editor is shown in the upper part of the screen while a keyboard occupies the lower part. The editor mostly is controlled via this keyboard, but a few functionalities work via the touch screen: taps in the left, upper, right or lower part of the editor portion of the screen work exactly as the arrow keys and up- and downward swipes scroll up and down. Pinching movements in- or decrease the font size used for the editor. A long tap (or a press of the menu button) brings up a on-screen movement for selection of the keyboard layout and rotation. Short presses of the forward and backward buttons cycle through the keyboard layouts and long presses increase or decrease the fomt size.

There are two packages you can download. The compressed tar archive contains all the sources as well as the pre-compiled binaries. The zip archive consists of the binaries only. A short installation instruction can be found in the README-vip file. Note that the packages are rather large (13 and 8.5 MB) - this is due to the complete vim runtime environment - you rather likely will pare that down to what you really want installed.

Here are the links:

http://users.physik.fu-berlin.de/~jtt/PB/vip.tar.gz
http://users.physik.fu-berlin.de/~jtt/PB/vip.zip
http://users.physik.fu-berlin.de/~jtt/PB/README-vip.txt

The program was tested on a PB622 with firmware 4.2 and a PB623 with firmware 4.3. I can't say if they also work properly with other devices.

Best regards, Jens
jtt is offline   Reply With Quote
Old 10-12-2013, 05:33 AM   #2
Tom.P
Member
Tom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a Texan
 
Posts: 12
Karma: 18082
Join Date: Oct 2013
Device: Pocketbook Touch Lux
I'm getting this, when trying to write something:
Code:
E353: Nothing in register "
What can i do?
Tom.P is offline   Reply With Quote
Old 10-12-2013, 06:15 AM   #3
jtt
Connoisseur
jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.
 
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
Quote:
Originally Posted by Tom.P View Post
I'm getting this, when trying to write something:
Code:
E353: Nothing in register "
What can i do?
Nice to see that it seems to be working as intended;-) This is a typical vi error message. I guess that you typed either 'p' or 'P' while not in insert mode, which in this case is the 'paste' command. And since you haven't 'yanked' (i.e. copied) text yet vi hasn't anything to paste, so you get that error message. If you want to type in text you first have to switch to insert mode by typing e.g. 'i'. To get out of insert mode again press <Esc>.

Best regards, Jens
jtt is offline   Reply With Quote
Old 10-12-2013, 09:04 AM   #4
Tom.P
Member
Tom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a Texan
 
Posts: 12
Karma: 18082
Join Date: Oct 2013
Device: Pocketbook Touch Lux
Well, maybe I should have downloaded that version for PC first as you sad BTW thanks
Tom.P is offline   Reply With Quote
Old 10-12-2013, 09:20 AM   #5
jtt
Connoisseur
jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.
 
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
Quote:
Originally Posted by Tom.P View Post
Well, maybe I should have downloaded that version for PC first as you sad BTW thanks
Since you posted a virtual box image with Linux for development a few days ago you may already have vi(m) in there - vi gets installed more or less per default an all Unix systems;-) And then you can try it out in its "natural habitat" (which is more or less the same as on the PocketBook itself).

Best regards, Jens
jtt is offline   Reply With Quote
Old 10-12-2013, 12:52 PM   #6
Tom.P
Member
Tom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a TexanTom.P might easily be mistaken for a Texan
 
Posts: 12
Karma: 18082
Join Date: Oct 2013
Device: Pocketbook Touch Lux
I have almost no knowledge of Linux. I will be pleased, if you can help me with some bugs. especially overlapping font in console.
Tom.P is offline   Reply With Quote
Old 10-12-2013, 01:22 PM   #7
jtt
Connoisseur
jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.
 
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
Quote:
Originally Posted by Tom.P View Post
I have almost no knowledge of Linux. I will be pleased, if you can help me with some bugs. especially overlapping font in console.
Just tell me the details and I'll try to answer - but perhaps it's simpler if we do this via email, my email address is jt@toerring.de.

Best regards, Jens
jtt is offline   Reply With Quote
Old 10-17-2013, 10:26 AM   #8
paolog
Zealot
paolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five words
 
paolog's Avatar
 
Posts: 117
Karma: 37584
Join Date: Nov 2012
Location: Milan / Italy
Device: pocketbook touch 622
hi Jens

I installed vip and works.

I've a couple of bug. I'm absolutely newbie so may be I'm wrong.

When I,ve the listed directories, obtained with
Code:
:edit .
with the cursor over one directory, 'enter' doesn't open that directory

After editing an existing file
Code:
:wq
doesn't save
even
Code:
:up
doesn't save
error is E32 no file name (even if I use !)

thanks

Paolo

Last edited by paolog; 10-17-2013 at 10:43 AM.
paolog is offline   Reply With Quote
Old 10-17-2013, 10:58 AM   #9
paolog
Zealot
paolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five words
 
paolog's Avatar
 
Posts: 117
Karma: 37584
Join Date: Nov 2012
Location: Milan / Italy
Device: pocketbook touch 622
solved

't' opens the selected dir

as for saving, I opened with 'r' instead of 'e' ... with which works 'w'

paolog is offline   Reply With Quote
Old 10-17-2013, 12:19 PM   #10
jtt
Connoisseur
jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.
 
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
Hi Paolo,

Quote:
solved

't' opens the selected dir

as for saving, I opened with 'r' instead of 'e' ... with which works 'w'
Thanks for letting me know how this is used - I'm also not a vi(m) expert (I usually use emacs) and are also still learning the most important commands to use with vi!

Best regards, Jens
jtt is offline   Reply With Quote
Old 10-17-2013, 03:28 PM   #11
jtt
Connoisseur
jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.
 
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
Bug fix

Hi Paolo,

you were completely right, there was a bug. You shouldn't have to use 't' to enter a directory, just pressing the <Enter> key is supposed to do that. The problem was that the <Enter> key actually send '\n' instead of '\r' to vim, which I now understand was wrong. Changing that got rid of the of the problem you encountered.

Please download the new 1.1 version that is now available via the links in my first post in this thread.

Best regards, Jens
jtt is offline   Reply With Quote
Old 10-18-2013, 04:16 AM   #12
paolog
Zealot
paolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five words
 
paolog's Avatar
 
Posts: 117
Karma: 37584
Join Date: Nov 2012
Location: Milan / Italy
Device: pocketbook touch 622
HI Jens

now works as expected.

as you know from pbterm, I ask, you see if it's handy to make it:

in the vim documentation/settings there are the choice to support the mouse

with the touch you already gave us the tap to move the cursor in the four directions

do you think it's possible to handle the touch like a mouse so? for instance, if I've to go to the center of the screen to edit the file, I can just tap over the point where I want to start editing

thanks and best regards

Paolo
paolog is offline   Reply With Quote
Old 10-18-2013, 04:19 AM   #13
paolog
Zealot
paolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five wordspaolog can name that ebook in five words
 
paolog's Avatar
 
Posts: 117
Karma: 37584
Join Date: Nov 2012
Location: Milan / Italy
Device: pocketbook touch 622

any suggestion to clean the vim runtime directory from unusable stuffs on e-ink to reduce the size of the runtime itself?

bye Paolo
paolog is offline   Reply With Quote
Old 10-18-2013, 05:16 AM   #14
jtt
Connoisseur
jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.
 
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
Hi Paolo,

Quote:
in the vim documentation/settings there are the choice to support the mouse with the touch you already gave us the tap to move the cursor in the four directions

do you think it's possible to handle the touch like a mouse so? for instance, if I've to go to the center of the screen to edit the file, I can just tap over the point where I want to start editing
I've been thinking about that. The tapping for moving in the four direction was simple to implement since all you have to do is send the keycode for one of the arrow keys to vim. Getting the touch screen to work in a mouse-like fashion is a bit more difficult since it might require further modifications to vim itself. While it looks possible in principle via the sysmouse handling I haven't spend enough time yet thinking properly about it. Perhaps it's even simpler than I assumed at first (it looks a bit as if vim's own reaction to a mouse click is also just stuffings some data into it's own input buffer, which could be simple to emulate). In any case it's definitely something to consider for a new version!

Another question would be how to deal with the different mouse buttons, marking regions etc. - when we start down that road it would be nice if it could be done properly;-)

Best regards, Jens
jtt is offline   Reply With Quote
Old 10-18-2013, 05:51 AM   #15
jtt
Connoisseur
jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.jtt composes epic poetry in binary.
 
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
Quote:
any suggestion to clean the vim runtime directory from unusable stuffs on e-ink to reduce the size of the runtime itself?
Well, not being a vi expert myself I can just guess, but I think throwing away all image files won't harm at all. Then it's the question if you want the documentation - I find it rather hard to read and use from within vim - perhaps it would be better to get a HTML version and read that the "normal" way. Since there are no menus it's probably save to delete the 'lang' directory which seems to contain translations of menu entries for a lot of languages. The 'syntax' directory seems to contain files for syntax highlighting for a lot of file types, most of which you probbaly will never encounter on the PocketBook. Same for the 'indent' directory. In 'spell' there seem to be spellchecker files for 49 different languages. I don't know how polyglot you are, but there might be one or two that you don't speak and don't expect to learn in the near future;-) Also the 'tutor' directory might be superfluous, and even if you want to keep it you may not need the files in all those different languages and encodings. Also 'autoload' contains some files you may get rid off - do you edit ADA or Ruby files on the PocketBook? And also the 'keymap' directory doesn't look very useful to me.

Best regards, Jens
jtt is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pocketbook Touch Lux 623 ausprobieren? tashk PocketBook 2 10-01-2013 11:51 PM
PocketBook Touch Lux (623) : various questions latruffe PocketBook 1 09-13-2013 05:21 PM
Willkürliche Umbrüche FBREADER Pocketbook 623 fboedecker PocketBook 1 08-09-2013 06:52 AM
First impressions PocketBook Touch 2 Lux 623 kacir PocketBook 32 07-28-2013 09:14 AM
PB 623 vs 622: Tastenkonfiguration/Menü JuergenM PocketBook 3 06-03-2013 09:33 AM


All times are GMT -4. The time now is 04:10 PM.


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