{"id":13507954,"url":"https://github.com/atom/keyboard-layout","last_synced_at":"2025-03-30T09:33:15.692Z","repository":{"id":21047294,"uuid":"24346061","full_name":"atom/keyboard-layout","owner":"atom","description":"Node module to read and observe the current keyboard layout","archived":true,"fork":false,"pushed_at":"2022-10-11T23:06:27.000Z","size":136,"stargazers_count":61,"open_issues_count":23,"forks_count":48,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-14T23:19:52.082Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/atom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-22T21:20:54.000Z","updated_at":"2022-12-15T20:12:39.000Z","dependencies_parsed_at":"2022-09-02T20:11:22.697Z","dependency_job_id":null,"html_url":"https://github.com/atom/keyboard-layout","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fkeyboard-layout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fkeyboard-layout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fkeyboard-layout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fkeyboard-layout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atom","download_url":"https://codeload.github.com/atom/keyboard-layout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246178393,"owners_count":20736138,"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":[],"created_at":"2024-08-01T02:00:44.119Z","updated_at":"2025-03-30T09:33:15.412Z","avatar_url":"https://github.com/atom.png","language":"C++","readme":"##### Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our [official announcement](https://github.blog/2022-06-08-sunsetting-atom/)\n # keyboard-layout\n[![CI](https://github.com/atom/keyboard-layout/actions/workflows/ci.yml/badge.svg)](https://github.com/atom/keyboard-layout/actions/workflows/ci.yml)\n\nRead and observe the current keyboard layout.\n\nTo get the current keyboard layout, call `getCurrentKeyboardLayout`. It returns\nthe string identifier of the current layout based on the value returned by the\noperating system.\n\n```js\nconst KeyboardLayout = require('keyboard-layout')\nKeyboardLayout.getCurrentKeyboardLayout() // =\u003e \"com.apple.keylayout.Dvorak\"\n```\n\nIf you want to watch for layout changes, use `onDidChangeCurrentKeyboardLayout`\nor `observeCurrentKeyboardLayout`. They work the same, except\n`observeCurrentKeyboardLayout` invokes the given callback immediately with the\ncurrent layout value and then again next time it changes, whereas\n`onDidChangeCurrentKeyboardLayout` only invokes the callback on the next\nchange.\n\n```js\nconst KeyboardLayout = require('keyboard-layout')\nsubscription = KeyboardLayout.observeCurrentKeyboardLayout((layout) =\u003e console.log(layout))\nsubscription.dispose() // to unsubscribe later\n```\n\nTo return characters for various modifier states based on a DOM 3\n`KeyboardEvent.code` value and the current system keyboard layout, use\n`getCurrentKeymap()`:\n\n```js\nconst KeyboardLayout = require('keyboard-layout')\nKeyboardLayout.getCurrentKeymap()['KeyS']\n/*\nOn a US layout, this returns:\n{\n  unmodified: 's',\n  withShift: 'S',\n  withAltGraph: 'ß',\n  withShiftAltGraph: 'Í'\n}\n*/\n```\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatom%2Fkeyboard-layout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatom%2Fkeyboard-layout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatom%2Fkeyboard-layout/lists"}