Giter Site home page Giter Site logo

Comments (14)

artemanufrij avatar artemanufrij commented on September 23, 2024

@jlnr currently you can do that by press + LEFT/RIGHT. But I think your suggestion is very useful. Give me a moment 👍

from webpin.

artemanufrij avatar artemanufrij commented on September 23, 2024

@jlnr in my case they are 8/9

from webpin.

artemanufrij avatar artemanufrij commented on September 23, 2024

@jlnr could you test current master branch please?

from webpin.

jlnr avatar jlnr commented on September 23, 2024

Wow, that was quick :) Right now mkdir build && cd build && cmake .. is choking on this:

CMake Error at CMakeLists.txt:27 (include):
  include could not find load file:

    ValaPrecompile


CMake Error at CMakeLists.txt:28 (find_package):

Edit: Never mind, I was missing the cmake-elementary package.

from webpin.

jlnr avatar jlnr commented on September 23, 2024

Back works, forward doesn't.

from webpin.

jlnr avatar jlnr commented on September 23, 2024

I've just looked at the source code and I wonder if my mouse is to blame. I had to remap my fifth mouse button to XF86Forward using command-line magic because by default it is mapped to something silly. This mapping works fine throughout elementaryOS, including Epiphany, but maybe it's throwing off the JavaScript button numbers?

Edit: I've connected another mouse and both back (physical button 4) and forward (physical button 5) work. I'm fine with closing this issue and just blaming the broken forward key on my mouse setup.

from webpin.

artemanufrij avatar artemanufrij commented on September 23, 2024

@jlnr I don't know... I use some Logitech and Dell mouse devices without modifying it. And it works fine in all browsers and other apps like Files. 🤷‍♂️

from webpin.

jlnr avatar jlnr commented on September 23, 2024

Ah, got it. Mice usually send button 8/9. However, there are also Gdk key constants for Back/Forward navigation (for monstrosities like this - I think I might've owned this one before, I remember having these keys), and that's what I've mapped my mouse button to.

So if I add this in addition to the button_press handler, everything works for me:

            web_view.key_press_event.connect ((event) => {
                if (event.keyval == Gdk.Key.Back) {
                    web_view.go_back ();
                    return true;
                } else if (event.keyval == Gdk.Key.Forward) {
                    web_view.go_forward ();
                    return true;
                }
                return base.key_press_event (event);
            });

Obviously I should also reconsider the way I've mapped my mouse button 😅, but as the rest of elementary apparently understands the navigation Gdk.Keys, I would still suggest adding the above code.

from webpin.

artemanufrij avatar artemanufrij commented on September 23, 2024

let me try it...

from webpin.

artemanufrij avatar artemanufrij commented on September 23, 2024

@jlnr Gdk.Key.Back doesn't work. Its value is 269025062 😕

I guess it means keyboard key and not mouse button

from webpin.

jlnr avatar jlnr commented on September 23, 2024

Yes, I had to set the key_press_event handler in addition to button_press_event (from your commit).

from webpin.

artemanufrij avatar artemanufrij commented on September 23, 2024

I see.. good point! I pushed it into current master

from webpin.

jlnr avatar jlnr commented on September 23, 2024

Great, thanks!

from webpin.

artemanufrij avatar artemanufrij commented on September 23, 2024

@jlnr thank you for your support! New release is waiting for approve...

from webpin.

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.