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 intercepting #11

Closed

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 added 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