mozilla-mobile / fenix

⚠️ Fenix (Firefox for Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
https://github.com/mozilla-mobile/firefox-android
Mozilla Public License 2.0
6.47k stars 1.27k forks source link

keyboard shortcuts #3729

Closed nahuhh closed 1 year ago

nahuhh commented 5 years ago

I am using a BlackBerry, for what it's worth.

Why/User Benefit/User Problem

Keyboard shortcuts are currently supported (awesome!). Hopefully it shouldn't be too difficult to add a "few" more.

Currently implemented

What/Requirements

Requested (asterisk mark ones I feel are of lower priority)

┆Issue is synchronized with this Jira Task

robsmith11 commented 5 years ago

Another use case is a phone or tablet with a Bluetooth keyboard. It's common to not have a mouse, to it's a nice to be able to navigate Firefox using the keyboard.

The ability to focus the Awesome bar with the keyboard is most important I think.

Other keyboard shortcuts could be set with an Addon like Vim Vixen: https://addons.mozilla.org/en-US/firefox/addon/vim-vixen/

NotWoods commented 5 years ago

It would be great if external contributors can add some of the shortcuts listed here. Feel free to make a PR even if you implement only 1 keyboard shortcut.

MemoryOverclocked commented 5 years ago

Hi, I would like to work on this.

robsmith11 commented 5 years ago

I was just wondering: if keyboard shortcuts are hardcoded in Fenix, would it still be possible for addons to override them?

robsmith11 commented 4 years ago

@NotWoods Is it possible to point to an example of where to add keyboard shortcuts in the Fenix/AndroidComponents/GeckoView code base?

I'd really like to try adding 1 or 2 that are necessary for me to switch to Fenix:

Most of the other keyboard shortcuts can be implemented in a WebExtension I think.

NotWoods commented 4 years ago

@robsmith11 Unfortunately I don't think we current support custom keyboard shortcuts beyond the default Android shortcuts. I recommend looking at the Android documentation.

robsmith11 commented 4 years ago

@NotWoods Thanks. I found what I think is the Ctrl-T newtab shortcut code in Fennec:

https://github.com/jrmuizel/mozilla-central-skia/blob/master/mobile/android/base/BrowserApp.java#L341

Where do you think I should add similar code to Fenix? Somewhere in Android-Components?

EDIT: Here?

https://github.com/mozilla-mobile/fenix/blob/master/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationView.kt#L316

NotWoods commented 4 years ago

I think we can start with defining them in Fenix and potentially move it to Android Components later on. Try to define them around associated views. For example, the collection creation view you linked to should have keyboard shortcuts for navigating collections but not opening new tabs. Maybe new tab should live with the toolbar view?

pocmo commented 4 years ago

Also see: https://github.com/mozilla-mobile/android-components/issues/1978

yoasif commented 4 years ago

This is now a regression and should also be labeled Feature:FennecTransition

People miss keyboard shortcuts: https://www.reddit.com/r/firefox/comments/i5bnz1/android_firefox_no_longer_supports_keyboard/

gaul commented 4 years ago

I tried to address this issue by calling components.useCases.sessionUseCases when handling KeyEvents in HomeActivity.onKeyDown. However, this only works before interacting with the page, e.g., scrolling, and not afterwards. Any suggestions on the proper place to add this logic?

headbank commented 3 years ago

Another use case is a phone or tablet with a Bluetooth keyboard. It's common to not have a mouse, to it's a nice to be able to navigate Firefox using the keyboard.

I don't agree with this assertion. IMO the majority of people who employ an external keyboard with a mobile device are likely to have some form of pointing device (mouse, touchpad) to accompany it. Even many small/cheap BT/USB minikeyboards these days have an integrated touchpad.

I don't mean to imply that keyboard-only isn't a valid use-case or undeserving of attention -- even when I have a pointing device I'd often rather use keyboard shortcuts just to reduce hand travel when doing keyboard-centric work -- I just wouldn't want keyboard+pointer to be overlooked on the basis of an assessment of constituencies that is, in my view, wide of the mark.

Full disclosure: What I really want for Christmas is CTRL+click to open link in new tab because my touchpad doesn't have a middle-click action ;)

alexanderadam commented 3 years ago

I don't agree with this assertion.

I agree with it though. Even Samsung made keyboard covers that contained no touchpad/mouse for most of the time. The S6 was the first that had a touchpad. Even the S5 convert only had a keyboard with no pointing device.

And Samsung is not a cheap brand.

Apart from this, this discussion itself is not leading to anything and therefore not helpful for anything. The fact that there are enough users with a keyboard and no pointing device should be enough to vote for this issue. :wink:

headbank commented 3 years ago

With respect, you are pointing to a years-old iteration of a very specific sub-type of keyboard accessory (and you even point out that thereafter, that product line has had a pointing-device). You're quite correct that Samsung is not a cheap brand, but I think perhaps you misunderstood my point there - for precisely that reason, you will find far more of the cheap aftermarket devices such as I was referring to, than the overpriced OEM accessories such as this, in use out in "the wild".

I want to reiterate, although I thought I made this clear enough above, that I'm fully in favour of keyboard-only support. My intent, as this ticket addresses keyboard shortcut functionality in general but the first comment on it sought to narrow its focus to keyboard-only considerations, is simply to entreat that its scope must remain inclusive to keyboard+pointer users as well. I gave my reasoning for that and (again with respect) your comment has not invalidated them.

In any case I stand by my contribution and I hope you'll reconsider your rather blunt assessment of its merits.

gaul commented 3 years ago

Perhaps a more common use case is Fenix on Chromebooks. I bought a Lenovo Duet which works well in tablet mode but poorly in keyboard mode. It is irritating to use even though the keyboard has a trackpad and I would prefer to use keyboard shortcuts for common actions.

fraunos commented 3 years ago

Yeah, I also recently acquired a BT keyboard and it bothers me there are no keyboard shortcuts. I think the desktop shortcuts should work on mobile too. Is anyone working on this? I have pretty much zero experience with Android development, so it could take me a while to do it - but I guess I could try.

mxmilkiib commented 3 years ago

I'm using Dex on my Note9 with a dock and a split Moonlander keyboard, and a Vimium user on desktop. The lack of browser hotkeys on Android is a big step-back in usability.

testman42 commented 3 years ago

I'm interested in keyboard shortcuts as well. My use case is generic keyboard connected to the tablet via USB hub.

alexanderadam commented 3 years ago

With respect, you are pointing to a years-old iteration of a very specific sub-type of keyboard accessory

Kind of. I pointed that out in 2020 and the Galaxy Tab S5e came out in 2019. So I'm sure that you'll manage to do the math and find out how many years are inbetween. :laughing:

Also Samsung is one of the major Android brands and the mentioned "very specific sub-type of keyboard accessory" is the standard keyboard cover for the S5e that someone can buy officially from Samsung.

But again. I really don't care whether you investigate your own claims or not, because…

this discussion itself is not leading to anything and therefore not helpful for anything. The fact that there are enough users with a keyboard and no pointing device should be enough to vote for this issue. wink

Firefox users expect to have good user experience. This includes that the user experience on Android (i.e. on mobile devices or Android Desktops) shouldn't deliver much less productivity than what it is known from the desktop version.

headbank commented 3 years ago

Sorry, you are quite right. I looked-up the age of the S5 phone to base my reply on, not realising how far in years the tablets diverge from the phones. I'm sorry if I caused such offense, not my intention.

My only interest here is to advocate for keyboard+pointer shortcuts also to be considered alongside the keyboard-only shortcuts, so those using Android in a more desktop-like setup (which is becoming more common now) can have a mode of use as close as possible to Desktop.

dredmorbius commented 3 years ago

I'll note that Chrome/Android has hotkey support, and as a keyboard+tablet user, it's a huge differentiator between the browsers.

I absolutely try to minimise my use of Chrome, but without keyboard support, Firefox / Fennec ... lags severely.

That's despite many other excellent features, and remarkable progress in performance over the years.

dredmorbius commented 3 years ago

Ctrl-P for print (or print-to-PDF) would also be strongly appreciated.

Rather than itemise individual hotkeys, I don't see why all (or at least all applicable) Desktop hotkeys shouldn't be supported.

A listing of those might be handy.

eUgEntOptIc44 commented 3 years ago

@NotWoods @pocmo any news on this issue? Would be very grateful if you could look into this any time soon.

eUgEntOptIc44 commented 3 years ago

As mentioned by @yoasif users miss this feature for over a year now and haven't heard (much) about progress on implementing it.

alive4ever commented 2 years ago

Recently bumping into this issue.

Would like to have the usual desktop keyboard shortcut, such as ctrl+l or alt+d to focus into address bar, ctrl+f to find text in page, alt+f for opening menu.

+1 for this feature!

alien2003 commented 2 years ago

This made me switch to Vivaldi

ghost commented 2 years ago

Still no movement on this? It is, in my opinion, essential to have

DietmarSchwertberger commented 2 years ago

Ctrl-T and Ctrl-W used to work, but stopped with an update some weeks ago and have not come back with version 103. Now it's a pain to use Firefox on a Cosmo Communicator.

enigma9o7 commented 2 years ago

I'm shocked basic keyboard shortcuts dont work on firefox for android. Besides the fxtec.com phone I'm using, anyone can use bluetooth or usb otg keyboard on new phone/tablet would expect basic keyboard commands to work. I'm subscribing to this, but obviously have to go find another browser for this device, which is annoying cuz I use firefox on everything else.

plwt commented 2 years ago

User feedback: https://support.mozilla.org/en-US/questions/1393050

headbank commented 1 year ago

I was just looking at #2344 and since it's not on the list above, may I add for consideration:

Ctrl+Tab/Backtab - Switch tabs

If some day we do get a keyboard-friendly Fenix, I really wouldn't want this one not to make the cut by omission. It's probably my most-used shortcut on desktop now I think of it.

This might require additional plumbing for desktop-equivalent behaviour, because I don't know whether the existing Tab Tray tracks the "last-visited" order of your tabs, anyone know? Also I think you would want the paging to include inactive tabs, so that might need to be squared with how the Tab Tray normally displays.

nahuhh commented 1 year ago

@NotWoods Bumping this

niemeyer commented 1 year ago

This issue has been opened for 11 years now, and as better tablets start to show up, some carrying hardware keyboards, and all of them able to use good external bluetooth ones, this issue is literally a deal breaker. I've been using Firefox on Android for many years now, and I literally have no option other than moving on so that I can use an external keyboard for those cases. I'll be watching, but meanwhile will be using the browser next door.

nahuhh commented 1 year ago

This issue has been opened for 11 years now, and as better tablets start to show up, some carrying hardware keyboards, and all of them able to use good external bluetooth ones, this issue is literally a deal breaker. I've been using Firefox on Android for many years now, and I literally have no option other than moving on so that I can use an external keyboard for those cases. I'll be watching, but meanwhile will be using the browser next door.

Actually, your referenced issue was closed shortly before the current one was opened.

niemeyer commented 1 year ago

Actually, your referenced issue was closed shortly before the current one was opened.

Ah, so that bug about the lack of keyboard shortcuts on Mozilla's Android web browser was closed shortly before this bug about the lack of keyboard shortcuts on Mozilla's Android web browser was opened? ;)

Yes, we could easily argue details, but it would be nicer to have support for hardware keyboards, per report from 11 years ago.

nahuhh commented 1 year ago

Actually, your referenced issue was closed shortly before the current one was opened.

Ah, so that bug about the lack of keyboard shortcuts on Mozilla's Android web browser was closed shortly before this bug about the lack of keyboard shortcuts on Mozilla's Android web browser was opened? ;)

No, I mean they fixed it in fennec... right before discontinuing fennec. They then neglected to bring the feature over to fenix, spawning this issue (im the OP of this issue..)

niemeyer commented 1 year ago

Yes, we could easily argue details

DietmarSchwertberger commented 1 year ago

No, I mean they fixed it in fennec... right before discontinuing fennec.

I was not aware of this switch. So, is this the reason why Ctrl-W and Ctrl-T used to work unti a few months ago on my Cosmo Communicator? What a fail. I'm using Opera now on my mobile keyboard devices.

Zeioth commented 1 year ago

Just a reminder that foldable phones are starting to make more and more people use their phones as computers. It would be nice having keyboard shortcuts back.

pedrovhb commented 1 year ago

Writing from Android with only a bluetooth keyboard as we speak (type?), I really want this feature 🙂

It's annoying to set up my phone in a nice position and type away, only to have to constantly reach out and touch the screen when I need to change tabs/type in a new URL/open a new tab, all of which I have extensive muscle memory for from the desktop.

Is anyone more familiar with the codebase able to give me some pointers on where I might start looking if I were to give a go at implementing it? As mentioned further above in the thread, some things like space and shift + space for scrolling up and down do work, so I'm hopeful it's not an exceedingly complex task for a first-time contributor.

csadilek commented 1 year ago

This is now tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1794664.

orionlee commented 1 year ago

@csadilek it'd be great if the bugzilla issue contains a list of keyboard shortcuts it is supposed to address.

nahuhh commented 1 year ago

@csadilek it'd be great if the bugzilla issue contains a list of keyboard shortcuts it is supposed to address.

This ^