0.1.6 • Published 3 years ago

@onurkantar/react-native-key-event-listener v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-native-key-event-listener

handles the external inputs

Installation

npm install react-native-key-event-listener

Usage

import { KeyEvent  } from "react-native-key-event-listener";

// ...

componentDidMount() {
    // if you want to react to keyDown
    KeyEvent.onKeyDownListener((keyEvent) => {
      console.log(`onKeyDown keyCode: ${keyEvent.keyCode}`);
      console.log(`Action: ${keyEvent.action}`);
      console.log(`Key: ${keyEvent.pressedKey}`);
    });
}

componentWillUnmount() {
    // if you are listening to keyDown
    KeyEvent.removeKeyDownListener();
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.0

3 years ago