@leonabcd123/modern-caps-lock 3.0.6 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,9 +13,7 @@ Modern Caps Lock provides an easy way to check whether Caps Lock is active, and
13
13
  3. [Examples](#examples)
14
14
  1. [Print Caps Lock state after every change](#print-caps-lock-state-after-every-change)
15
15
  2. [Get current Caps Lock state](#get-current-caps-lock-state)
16
- 4. [Support](#support)
17
- 1. [Supported Platforms](#supported-platforms)
18
- 2. [Unsupported Platforms](#unsupported-platforms)
16
+ 4. [Supported Platforms](#supported-platforms)
19
17
  5. [Limitations](#limitations)
20
18
  6. [Credits](#credits)
21
19
 
@@ -77,18 +75,13 @@ if (isCapsLockOn()) {
77
75
  }
78
76
  ```
79
77
 
80
- ### Support
81
-
82
- ##### Supported Platforms
78
+ ### Supported Platforms
83
79
 
84
80
  - Windows
85
81
  - Mac
86
82
  - Linux
87
83
  - iPad
88
-
89
- ##### Unsupported Platforms
90
-
91
- - Platforms using [GBoard](https://en.wikipedia.org/wiki/Gboard)
84
+ - Android
92
85
 
93
86
  ### Limitations
94
87
 
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getCurrentOs } from "./os-detection";
1
+ import { getCurrentOs } from "./os-detection.js";
2
2
  let previousCapsState = false;
3
3
  let capsState = false;
4
4
  const os = getCurrentOs();
@@ -41,7 +41,7 @@ document.addEventListener("keyup", (event) => {
41
41
  else if (os === "Windows") {
42
42
  capsState = getCapsLockModifierState(event);
43
43
  }
44
- else if (event.key !== "CapsLock") {
44
+ else if (event.key !== "CapsLock" && event.key !== "Unidentified") {
45
45
  capsState = getCapsLockModifierState(event);
46
46
  }
47
47
  callCallbackIfNeeded();
@@ -6,7 +6,7 @@ export function getCurrentOs() {
6
6
  if (isPlatform(/Mac/i)) {
7
7
  return "Mac";
8
8
  }
9
- if (isPlatform(/Linux/i)) {
9
+ if (isPlatform(/Linux|Android/i)) {
10
10
  return "Linux";
11
11
  }
12
12
  if (isPlatform(/Win/i)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonabcd123/modern-caps-lock",
3
- "version": "3.0.6",
3
+ "version": "3.1.1",
4
4
  "description": "A package that allows you to check whether caps lock is active or not",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",