Skip to content

Keyboard intercepting#11

Closed
joehinkle11 wants to merge 2 commits intoActuallyTaylor:mainfrom
joehinkle11:keyboard-intercepting
Closed

Keyboard intercepting#11
joehinkle11 wants to merge 2 commits intoActuallyTaylor:mainfrom
joehinkle11:keyboard-intercepting

Conversation

@joehinkle11
Copy link
Contributor

Video of me using this API get intercept the keyboard events like up and down arrow

https://twitter.com/joehink95/status/1382482305814392833

example code

func keyCommands(selector: Selector) -> [UIKeyCommand] {
  return [
    UIKeyCommand(action: selector, input: UIKeyCommand.inputUpArrow),
  ]
}
func receiver(sender: UIKeyCommand) {
 print(sender) // i.e. up arrow
}

// in your view
FireflySyntaxEditor(
  text: $text,
  implementUIKeyCommands: (keyCommands, receiver),
  language: "swift",
  theme: "Xcode Light",
  fontName: "system",
  didChangeText: { _ in},
  didChangeSelectedRange: {_,_ in},
  textViewDidBeginEditing: {_ in}
)

ActuallyTaylor pushed a commit that referenced this pull request Jul 1, 2021
#9 Now supports macOS
#11 Does not yet support macOS
@ActuallyTaylor
Copy link
Owner

This has been merged into https://github.com/ActuallyZach/Firefly/tree/MacOS

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 this pull request may close these issues.

2 participants