Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touchscreen scrolling by dragging content #447

Open
mashedkeyboard opened this issue Jul 7, 2019 · 14 comments
Open

Touchscreen scrolling by dragging content #447

mashedkeyboard opened this issue Jul 7, 2019 · 14 comments

Comments

@mashedkeyboard
Copy link

I'm using Shoes on a touchscreen device - is it possible to enable scrolling by dragging on the content rather than only on the scrollbar, as you'd expect from other applications, in some way?

I can't see an obvious way to implement this from within the Shoes DSL.

@ccoupe
Copy link

ccoupe commented Jul 7, 2019

Hi @mashedkeyboard . As you've noted, Shoes doesn't know about touch devices or drag. There are api's in the underlying Gtk3 and Cocoa libraries and perhaps we can get something working in Shoes. Perhaps re-purposing the wheel method would work for your example? I don't have a touch device to test with - what are you using and which OS ?

@mashedkeyboard
Copy link
Author

I'm using Linux (Raspbian) with a Raspberry Pi Touch display.

@ccoupe
Copy link

ccoupe commented Jul 7, 2019

Good - that's easier for me to work with than say a $2000 mac laptop. Which display? I might want one for my pi3. There aren't a lot of raspbian programs that use gtk3 (last I Iooked) - we need to know how gtk3 libs deal with that device starting with "Do they see it".

@mashedkeyboard
Copy link
Author

It's the official Raspberry Pi touch display - nothing fancy :)

I'm not too familiar with GTK's inner workings - is there some debug output I could provide that would be useful?

@ccoupe
Copy link

ccoupe commented Jul 8, 2019

Of course you want to try a web browser or two. There's boat load of stuff available if you set the right environment vars but don't do that - it's too hard, confusing and probably wont tell us what we want to know. I've got a Wacom tablet around here somewhere - not quite the same but maybe close enough for gtk3. Is there an applet or menu thing that you have to enable to use the touch screen? I could dig around the PI sites to learn but ...

I just installed a new SSD and a new version of Linux Mint so I'll be putting my system right for the next few days.

@ccoupe
Copy link

ccoupe commented Jul 9, 2019

This shows that Gtk3 and the RPI Touchscreen can work together. It also demonstrates why someone would prefer to use Shoes instead of Gtk3. This bit of documentation describes the general Gtk3 event handling. It might be as easy as just setting the GDK_TOUCH_MASK and the built in emulation will work. Sadly, the pi build is the one that has issues with my new mint19 host.

@ccoupe
Copy link

ccoupe commented Jul 9, 2019

@mashedkeyboard - I've got a beta for the pi with GDK_TOUCH_MASK enabled. Would you try it out with the touch screen and let me know what works and doesn't. Try the Manual->Furthermore->Sample->expert->curve-control-point and something that scrolls like Sample/simple/info and a click on the card in samples/good/cardflip.

Longer term, it might be pretty easy to create a 'touch' method like 'click' or 'motion'.

@mashedkeyboard
Copy link
Author

Cheers, that was fast!

Conclusions:

  • curve-control-point works exactly as expected!
  • info doesn't scroll unless you use the scrollbar :(
  • cardflip works as expected - but just tapping worked previously (at least in my app).

I also checked Chromium, and that definitely supports scrolling on places other than the scrollbar.

@ccoupe
Copy link

ccoupe commented Jul 10, 2019

Cheers, that was fast!

I like working on user requests that are interesting.

Currently, it's just treating touch like a second mouse with only one button. If your finger can fit on a scrollbar you might be able to drag it. Lot's of ifs, there. Providing a better mechanism is a little more complicated. I ordered a screen like yours and it should be here Friday. Lots of options for touch screens but I could tell that many of them could not work work with normal Gtk3 and Shoes. I also started a good test program - a rewrite of in Shoes. Reminds me why Shoes is fun.

ccoupe pushed a commit that referenced this issue Jul 10, 2019
@ccoupe
Copy link

ccoupe commented Jul 13, 2019

Now that my touch screen is working, I can see some other missing support in Shoes. The menus in Cobbler drop down but can't be selected. Odd. My kiosk rewrite works fine although it hasn't been tested as a full screen. My wacom Graphire tablet behaves as a mouse even when set in tablet mode.

@ccoupe
Copy link

ccoupe commented Jul 18, 2019

The good news is we can get touch events into Shoes. The raw events need to be passed to a new method 'touch' like 'motion', IFF there is a touch method declared by the script writer. samples/expert/curve-control point.rb doesn't work if we grab the events.

Looks like I'll want to implement GtkGestures on the GtkAltFixed container that Shoes uses. Not a place I like to play in, but we have to go where the bug is. @mashedkeyboard is asking for something like a drag or swipe gesture to be mapped to the current scrolling mechanism (assuming the widget or window is showing a scroll bar).

@ccoupe
Copy link

ccoupe commented Jul 19, 2019

Another worthy place to look at. The 'gtk-3-examples' package installs an app 'gtk3-demo' which is really useful to see how the touch screen works - works well on my pi3. Note: they don't do menu selection either (gtk 3.24.5 - very new)

ccoupe pushed a commit that referenced this issue Jul 21, 2019
some situations.
* does not pass touch events to a 'touch' method.
* some errors are other Shoes 3.3.8 bugs, some are touch related.
@ccoupe
Copy link

ccoupe commented Jul 21, 2019

@mashedkeyboard , I've got another beta which can scroll the Shoes screen - in some situations but not all. It's an appimage so just download, chmod +x and run it from the cmdline - that requires a keyboard. It does not replace any shoes you might have installed.

ccoupe pushed a commit that referenced this issue Jul 23, 2019
* does not have a 'touch' method because
* larger issue of gesture support is unresolved.
  and I don't have an Mac Trackpad.
@ccoupe
Copy link

ccoupe commented Jul 23, 2019

I'm going to close this issue. The latest beta works OK on the pi touch screen for the original problem. There are related problems/issues however. Gestures are not handled - I lack an OSX trackpad for one. The menu non-support is a known Gtk3 bug for all app's with a touch screen. Note, closing the issue doesn't mean the discussion can't continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants