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

Keyboard support #78

Closed
evant opened this issue Mar 27, 2024 · 2 comments · Fixed by #80
Closed

Keyboard support #78

evant opened this issue Mar 27, 2024 · 2 comments · Fixed by #80

Comments

@evant
Copy link
Contributor

evant commented Mar 27, 2024

This is probably most important for desktop usage but can also be useful on mobile if you have an external keyboard connected.

I would expect this to work out of the box:
ctrl+, ctrl-, ctrl0 to control zoom
arrow keys to pan when zoomed

@saket
Copy link
Owner

saket commented Mar 28, 2024

Good idea! I've been wanting to add an API for controlling the zoom and pan from code (#4). This would be a nice follow-up to that.

evant added a commit to evant/telephoto that referenced this issue Mar 28, 2024
Intial stab at this, I'm not sure all the code lives in the right place and looking for feedback on that.

Additional issues/questions:

- Is there a way to get the 'standard' system keyboard shortcuts for this?
- How to detech ctrl/meta + key press? I never saw them detected though I'm testing with the android emulator which does
	werid things with external keybaords.
- keyboard input enabled by default? note: view needs to be focused to start receiving events
- configure zoom & pan steps?

Fixes saket#78
saket pushed a commit that referenced this issue May 9, 2024
Intial stab at this, I'm not sure all the code lives in the right place and looking for feedback on that.

Additional issues/questions:

- Is there a way to get the 'standard' system keyboard shortcuts for this?
- How to detech ctrl/meta + key press? I never saw them detected though I'm testing with the android emulator which does
	werid things with external keybaords.
- keyboard input enabled by default? note: view needs to be focused to start receiving events
- configure zoom & pan steps?

Fixes #78
@saket saket closed this as completed in 7015d6e Jun 24, 2024
@saket
Copy link
Owner

saket commented Jul 13, 2024

Released in 0.12.0: https://github.com/saket/telephoto/releases/tag/0.12.0

ZacSweers referenced this issue in ZacSweers/CatchUp Jul 16, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[me.saket.telephoto:zoomable-image-coil](https://togithub.com/saket/telephoto)
| `0.11.2` -> `0.12.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable-image-coil/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable-image-coil/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable-image-coil/0.11.2/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable-image-coil/0.11.2/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[me.saket.telephoto:zoomable-image](https://togithub.com/saket/telephoto)
| `0.11.2` -> `0.12.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable-image/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable-image/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable-image/0.11.2/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable-image/0.11.2/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [me.saket.telephoto:zoomable](https://togithub.com/saket/telephoto) |
`0.11.2` -> `0.12.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable/0.11.2/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable/0.11.2/0.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>saket/telephoto
(me.saket.telephoto:zoomable-image-coil)</summary>

###
[`v0.12.0`](https://togithub.com/saket/telephoto/releases/tag/0.12.0)

[Compare
Source](https://togithub.com/saket/telephoto/compare/0.11.2...0.12.0)

New changes

-
[https://github.com/saket/telephoto/issues/78](https://togithub.com/saket/telephoto/issues/78):
Support for [keyboard and mouse
shortcuts](https://saket.github.io/telephoto/zoomableimage/#keyboard-shortcuts)
(by [@&#8203;evant](https://togithub.com/evant))
-
[https://github.com/saket/telephoto/issues/67](https://togithub.com/saket/telephoto/issues/67):
New APIs in `ZoomableState` for controlling zoom from code: `panBy`,
`zoomBy`, and `zoomTo`
-
[https://github.com/saket/telephoto/issues/32](https://togithub.com/saket/telephoto/issues/32):
New `onDoubleClick` parameters in `ZoomableImage()` and
`Modifier.zoomable()` for customizing double-click behavior
-
[https://github.com/saket/telephoto/issues/91](https://togithub.com/saket/telephoto/issues/91):
Reduced `minSdk` to 21 (by
[@&#8203;iwb-florien-flament](https://togithub.com/iwb-florien-flament))
- Significantly reduced the amount of work required by a
`ZoomableImageSource` by offloading the detection of bad content URIs to
`SubSamplingImageSource.contentUriOrNull()`

Bug fixes

-
[https://github.com/saket/telephoto/issues/93](https://togithub.com/saket/telephoto/issues/93):
`NullPointerException` when an image is zoomed before it is initialized
-
[https://github.com/saket/telephoto/issues/50](https://togithub.com/saket/telephoto/issues/50):
`FileNotFoundException: No content provider` when disk caching of an
image is disabled using `Cache-Control` HTTP headers.
- Fixed infinite reloading of images when unstable image request
listener are used in `ZoomableAsyncImage()`. This removes the need for
using `remember` with `ImageRequest.listener` and
`ImageRequest.placeholder` values.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ZacSweers/CatchUp).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQzMS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
github-merge-queue bot referenced this issue in slackhq/circuit Jul 17, 2024
…1516)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[me.saket.telephoto:zoomable-image-coil](https://togithub.com/saket/telephoto)
| dependencies | minor | `0.11.2` -> `0.12.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>saket/telephoto
(me.saket.telephoto:zoomable-image-coil)</summary>

###
[`v0.12.0`](https://togithub.com/saket/telephoto/releases/tag/0.12.0)

[Compare
Source](https://togithub.com/saket/telephoto/compare/0.11.2...0.12.0)

New changes

-
[https://github.com/saket/telephoto/issues/78](https://togithub.com/saket/telephoto/issues/78):
Support for [keyboard and mouse
shortcuts](https://saket.github.io/telephoto/zoomableimage/#keyboard-shortcuts)
(by [@&#8203;evant](https://togithub.com/evant))
-
[https://github.com/saket/telephoto/issues/67](https://togithub.com/saket/telephoto/issues/67):
New APIs in `ZoomableState` for controlling zoom from code: `panBy`,
`zoomBy`, and `zoomTo`
-
[https://github.com/saket/telephoto/issues/32](https://togithub.com/saket/telephoto/issues/32):
New `onDoubleClick` parameters in `ZoomableImage()` and
`Modifier.zoomable()` for customizing double-click behavior
-
[https://github.com/saket/telephoto/issues/91](https://togithub.com/saket/telephoto/issues/91):
Reduced `minSdk` to 21 (by
[@&#8203;iwb-florien-flament](https://togithub.com/iwb-florien-flament))
- Significantly reduced the amount of work required by a
`ZoomableImageSource` by offloading the detection of bad content URIs to
`SubSamplingImageSource.contentUriOrNull()`

Bug fixes

-
[https://github.com/saket/telephoto/issues/93](https://togithub.com/saket/telephoto/issues/93):
`NullPointerException` when an image is zoomed before it is initialized
-
[https://github.com/saket/telephoto/issues/50](https://togithub.com/saket/telephoto/issues/50):
`FileNotFoundException: No content provider` when disk caching of an
image is disabled using `Cache-Control` HTTP headers.
- Fixed infinite reloading of images when unstable image request
listener are used in `ZoomableAsyncImage()`. This removes the need for
using `remember` with `ImageRequest.listener` and
`ImageRequest.placeholder` values.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQzMS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants