{"id":18831424,"url":"https://github.com/kingstinct/react-native-hotkeys","last_synced_at":"2025-04-14T04:16:25.670Z","repository":{"id":38851109,"uuid":"429230305","full_name":"kingstinct/react-native-hotkeys","owner":"kingstinct","description":"React Native module to enable listening to and capturing hotkeys. Currently with support for iOS (tested on iPad and M1 Macs) and web.","archived":false,"fork":false,"pushed_at":"2024-02-03T17:29:17.000Z","size":6070,"stargazers_count":20,"open_issues_count":8,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T04:16:19.868Z","etag":null,"topics":["ios","react-native","web"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kingstinct.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-17T23:18:52.000Z","updated_at":"2025-03-28T09:06:08.000Z","dependencies_parsed_at":"2024-02-03T18:32:46.821Z","dependency_job_id":"5c32426e-182c-46d0-ae42-03f59bda9aa7","html_url":"https://github.com/kingstinct/react-native-hotkeys","commit_stats":null,"previous_names":["kingstinct/react-native-keys"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingstinct%2Freact-native-hotkeys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingstinct%2Freact-native-hotkeys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingstinct%2Freact-native-hotkeys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingstinct%2Freact-native-hotkeys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kingstinct","download_url":"https://codeload.github.com/kingstinct/react-native-hotkeys/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819410,"owners_count":21166477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","react-native","web"],"created_at":"2024-11-08T01:54:11.068Z","updated_at":"2025-04-14T04:16:25.647Z","avatar_url":"https://github.com/kingstinct.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-hotkeys\n\nReact Native module to enable listening to and capturing hotkeys. Currently with support for iOS (tested on iPad and M1 Macs) and web.\n\n# API documentation\n\n- [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/react-native-hotkeys.md)\n- [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/react-native-hotkeys/)\n\n# Installation in managed Expo projects\n\nFor [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](#api-documentation). If you follow the link and there is no documentation available then this library is not yet usable within managed projects \u0026mdash; it is likely to be included in an upcoming Expo SDK release.\n\n# Installation in bare React Native projects\n\nFor bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.\n\n### Add the package to your npm dependencies\n\n```\nnpm install react-native-hotkeys\n```\n\nor \n\n```\nyarn add react-native-hotkeys\n```\n\n### Configure for iOS\n\nRun `npx pod-install` after installing the npm package.\n\n# Usage\n\nStart by wrapping your app in the KeysProvider:\n```TypeScript\nimport {\n  KeysProvider\n} from 'react-native-hotkeys'\n\nconst App = () =\u003e {\n  return (\n    \u003cKeysProvider\u003e\n      \u003cYourApp /\u003e\n    \u003c/KeysProvider\u003e\n  )\n}\n```\n\nThe easiest way to use it is with the useHotkey Hook:\n```TypeScript\nimport {\n  ModifiersType, ReactNativeKeysKeyCode, useHotkey,\n} from 'react-native-hotkeys'\n\n// use the useHotkey hook anywhere\nuseHotkey(ReactNativeKeysKeyCode.Escape, (event) =\u003e {\n  // do something\n})\n\nuseHotkey(ReactNativeKeysKeyCode.ArrowLeft, (event) =\u003e {\n  // move player to the left\n})\n\n// use modifiers\nuseHotkey(ReactNativeKeysKeyCode.ArrowLeft, (event) =\u003e {\n  // do something different\n}, { modifiers: ModifiersType.Shift })\n\n// return true to indicate that the event was handled (and priority to override priority for nestled handlers)\nuseHotkey(ReactNativeKeysKeyCode.ArrowLeft, (event) =\u003e {\n  return true\n}, { priority: 10 })\n```\n\nOptionally you can directly use addEventListener:\n```TypeScript\naddEventListener(ReactNativeKeysKeyCode.Escape, (event) =\u003e {\n  // do something\n})\n```\n\n# Contributing\n\nContributions are very welcome! Please refer to guidelines described in the [contributing guide]( https://github.com/expo/expo#contributing).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingstinct%2Freact-native-hotkeys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkingstinct%2Freact-native-hotkeys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingstinct%2Freact-native-hotkeys/lists"}