Open mashedkeyboard opened 5 years ago
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 ?
I'm using Linux (Raspbian) with a Raspberry Pi Touch display.
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".
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?
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.
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.
@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'.
Cheers, that was fast!
Conclusions:
I also checked Chromium, and that definitely supports scrolling on places other than the scrollbar.
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.
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.
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).
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)
@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.
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.
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.