rmkit-dev / rmkit

| remarkable app framework | https://rmkit.dev
https://build.rmkit.dev
365 stars 32 forks source link

Adding Up & Down to Lamp #191

Closed flamaque closed 1 year ago

flamaque commented 1 year ago

Would it be possible to add the swipe gestures "up" and "down" to 'Lamp'? I tried to emulate it with finger down/finger move but that does not seem to work. (reMarkable2 3.0.4.1305) I couldn't even mimic the "left" or "right" swipe.

I figure it would be as easy to add the following code. But I have to little knowledge about building .ipk, or any application for the reMarkable2 at all, to do it myself.

else if action == "up": write_events(touch_fd, finger_up()) write_events(touch_fd, finger_move(500, 800, 500, 200, 20)) // swipe up write_events(touch_fd, finger_up()) usleep(100 * 1000) else if action == "down": write_events(touch_fd, finger_up()) write_events(touch_fd, finger_move(500, 200, 500, 800, 20)) // swipe down write_events(touch_fd, finger_up()) usleep(100 * 1000)

Eeems commented 1 year ago

Finger down, finger move, and then finger up should be all you need to do a swipe gesture in any direction.

What configuration were you using that didn't work? Have you checked the evtest output to confirm that it isn't sending events? Do you have any logs that may be useful?

flamaque commented 1 year ago

I've tried various combination with "finger down", "finger move" and "finger up", with different values. As well as swiping manually in between executing the commands, and hiding the menu bar. I tried mimicking the exact output on evtest as what "swipe right" and "swipe left" do, but to no avail.

I also tried cloning the rmkit repository, changing the code in "main.cpy" and rebuilding the .ipk But I only came to the conclusion that I am not colour-blind (also read: lot's of errors...)

I'm happy to provide a log file, just ask which one will be of use.

raisjn commented 1 year ago

just to check, do swipe right and swipe left work? I need to read the lamp code again

flamaque commented 1 year ago

@raisjn Yes, "swipe right" and "swipe left" work like a charm.

Eeems commented 1 year ago

I've tried various combination with "finger down", "finger move" and "finger up", with different values. As well as swiping manually in between executing the commands, and hiding the menu bar. I tried mimicking the exact output on evtest as what "swipe right" and "swipe left" do, but to no avail.

Do you have some examples for us to look at?

raisjn commented 1 year ago

try https://raisjn.net/lamp.swipes (it has your added code). download that file, scp to your remarkable and chmod +x the file, then try it out. for compiling the code, if you have docker installed you can run make lamp_docker from the root dir to build within a docker container. otherwise, see docs/BUILDING.md

if lamp.swipes works, i will update the code and push it to the repo

if you on rm2, you might need to run it like rm2fb-client lamp, but it might also work fine with just lamp

flamaque commented 1 year ago

@Eeems I did not keep track of all variants but these are the two I still have: For "Swipe up": finger down 750 1600 finger move 750 1000 finger up

For "Swipe down": finger down 200 500 finger move 1000 500 finger down 1000 500

But this is not relevant anymore since the "lamp.swipes" works. I'm just replying to be polite/find a probable bug/hear that I've done it wrong.

@raisjn The gestures work now! Using "./lamp.swipes < SwipeDown.in" it now swipes down (or next page in 'land scape' mode, which is what I wanted. I'll restart all in a bit and check if it still works, but thank you thus far!

And I've tried compiling using Ubuntu (20.04 for Windows) but it cannot find the "libc.so.6" and "libstdc++.so.6" files. But that is not a problem anymore since the "lamp.swipes" works.

flamaque commented 1 year ago

@raisjn All seems to work just fine, in PDF as well as notebooks. Sometimes it doesn't respond on the first try, but it does the second time. I notice that the tablet makes a hissing noise. (Like when an electric kettle starts up, but higher. Yes, flawless example.)

I figure this can be closed now?