Code Monkey home page Code Monkey logo

Comments (6)

Frenzie avatar Frenzie commented on June 26, 2024

Note that presently pressing left and right together is equivalent to two-finger touch/swipes.

from koreader.

offset-torque avatar offset-torque commented on June 26, 2024

I support this proposal from the UX perspective. I have been using the desktop KOReader for testing for a long time and still reflexively right click for the long-press menu. It is generally a very strong muscle memory with desktop users so it is a good idea to make it work as expected.

Note that presently pressing left and right together is equivalent to two-finger touch/swipes.

In theory, this makes sense. But I just tried it with a mouse and it is very uncomfortable to draw a gesture while pressing both buttons (and I have experience from using this combination as an emulated middle button under Linux). I would be surprised if someone uses this feature daily. Probably "single finger swipes with mouse" are the edges of usability.

from koreader.

Frenzie avatar Frenzie commented on June 26, 2024

It's probably not very challenging btw. If you check how I implemented scrolling you can do something similar:

if ev.code == SDL_MOUSEWHEEL then
local scrolled_x = ev.value.x
local scrolled_y = ev.value.y
local up = 1
local down = -1
local pos = Geom:new{
x = 0,
y = 0,
w = 0, h = 0,
}
local fake_ges = {
ges = "pan",
distance = 200,
relative = {
x = 50*scrolled_x,
y = 100*scrolled_y,
},
pos = pos,
time = time.timeval(ev.time),
mousewheel_direction = scrolled_y,
}
local fake_ges_release = {
ges = "pan_release",
distance = fake_ges.distance,
relative = fake_ges.relative,
pos = pos,
time = time.timeval(ev.time),
from_mousewheel = true,
}
local fake_pan_ev = Event:new("Pan", nil, fake_ges)
local fake_release_ev = Event:new("Gesture", fake_ges_release)
if scrolled_y == down then
fake_ges.direction = "north"
UIManager:sendEvent(fake_pan_ev)
UIManager:sendEvent(fake_release_ev)
elseif scrolled_y == up then
fake_ges.direction = "south"
UIManager:sendEvent(fake_pan_ev)
UIManager:sendEvent(fake_release_ev)
end

from koreader.

ryanwwest avatar ryanwwest commented on June 26, 2024

Note that presently pressing left and right together is equivalent to two-finger touch/swipes.

This doesn't necessarily need to change to support the right click behavior as I describe, right? I wouldn't use left and right click together and I'm guessing very few people will use it or even know about it, but I don't think we'd need to remove it.

Gestures with mouse aren't fluid, but since I use Syncthing to mirror my settings config across all devices, I know the few gestures I use well and it's occasionally nice to use them with mouse. Plus I use KOReader on web browser with https://github.com/koreader/virdevenv https://github.com/zephyros-dev/docker-koreader and it comes in handy there, especially on mobile devices where using your finger is technically using a mouse.

from koreader.

Frenzie avatar Frenzie commented on June 26, 2024

This doesn't necessarily need to change to support the right click behavior as I describe, right?

Perhaps not necessarily but then you're talking about something that may well be difficult to do. ;-)

It was mostly just a comment saying it doesn't do the same thing as left click but the same thing as a finger. I wrote it that way so that it'd be possible to test two-finger actions on the emulator without a touch screen. It's not important to keep it.

from koreader.

ryanwwest avatar ryanwwest commented on June 26, 2024

Sounds good. I may work on this and a few other FRs I've opened after my new Linux laptop arrives and when I have some free time, if someone else doesn't beat me to it.

from koreader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.