Skip to content

Commit

Permalink
Add some class documentation for HardwareShortcutsSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
saket committed Jul 13, 2024
1 parent bd8677d commit 9d6b177
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
package me.saket.telephoto.zoomable

import androidx.compose.runtime.Immutable
import androidx.compose.ui.focus.FocusRequester
import dev.drewhamilton.poko.Poko

/**
* Describes how keyboard and mouse shortcuts are handled. When [enabled], [Modifier.zoomable][zoomable]'s
* content will participate in the focus system to receive hardware events.
*
* Keep in mind that hardware shortcuts will not work until your zoomable content is focused.
* To do this automatically, use a [FocusRequester]:
*
* ```
* val focusRequester = remember { FocusRequester() }
* LaunchedEffect(Unit) {
* focusRequester.requestFocus()
* }
*
* ZoomableImage(
* modifier = Modifier.focusRequester(focusRequester),
* )
* ```
*/
@Poko
@Immutable
class HardwareShortcutsSpec(
Expand Down

0 comments on commit 9d6b177

Please sign in to comment.