@leonabcd123/modern-caps-lock 3.0.4 → 3.0.5

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
@@ -2,6 +2,23 @@
2
2
 
3
3
  Modern Caps Lock provides an easy way to check whether Caps Lock is active or not, and it allows you to run your code whenever Caps Lock state changes.
4
4
 
5
+ 1. [Installation](#installation)
6
+ 2. [API](#api)
7
+ 1. [`onCapsLockChange`](#oncapslockchange)
8
+ 1. [Arguments](#arguments)
9
+ 2. [Return value](#return-value)
10
+ 2. [`isCapsLockOn`](#iscapslockon)
11
+ 1. [Arguments](#arguments-1)
12
+ 2. [Return value](#return-value-1)
13
+ 3. [Examples](#examples)
14
+ 1. [Print Caps Lock state after every change](#print-caps-lock-state-after-every-change)
15
+ 2. [Get current Caps Lock state](#get-current-caps-lock-state)
16
+ 5. [Support](#support)
17
+ 1. [Supported Platforms](#supported-platforms)
18
+ 2. [Unsupported Platforms](#unsupported-platforms)
19
+ 6. [Limitations](#limitations)
20
+ 7. [Credits](#credits)
21
+
5
22
  ### Installation
6
23
 
7
24
  Example installation with npm:
@@ -12,7 +29,7 @@ npm install @leonabcd123/modern-caps-lock
12
29
 
13
30
  ### API
14
31
 
15
- #### onCapsLockChange()
32
+ #### onCapsLockChange
16
33
 
17
34
  Runs the provided callback function whenever Caps Lock state is changed.
18
35
 
@@ -24,7 +41,7 @@ Runs the provided callback function whenever Caps Lock state is changed.
24
41
 
25
42
  `void`.
26
43
 
27
- #### isCapsLockOn()
44
+ #### isCapsLockOn
28
45
 
29
46
  Returns the current Caps Lock state.
30
47
 
@@ -62,14 +79,14 @@ if (isCapsLockOn()) {
62
79
 
63
80
  ### Support
64
81
 
65
- ##### Supported Platforms:
82
+ ##### Supported Platforms
66
83
 
67
84
  - Windows
68
85
  - Mac
69
86
  - Linux
70
87
  - iPad
71
88
 
72
- ##### Unsupported Platforms:
89
+ ##### Unsupported Platforms
73
90
 
74
91
  - Platforms using [GBoard](https://en.wikipedia.org/wiki/Gboard)
75
92
 
package/lib/index.js CHANGED
@@ -49,9 +49,9 @@ document.addEventListener("keyup", (event) => {
49
49
  }
50
50
  else {
51
51
  const currentCapsState = getCapsLockModifierState(event);
52
- isSendingCapsLockStateOniPad || (isSendingCapsLockStateOniPad = currentCapsState);
53
- if (isSendingCapsLockStateOniPad) {
52
+ if (isSendingCapsLockStateOniPad || currentCapsState) {
54
53
  capsState = currentCapsState;
54
+ isSendingCapsLockStateOniPad = true;
55
55
  }
56
56
  }
57
57
  }
@@ -82,4 +82,3 @@ export function isCapsLockOn() {
82
82
  export function onCapsLockChange(callback) {
83
83
  onCapsChangeCallback = callback;
84
84
  }
85
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonabcd123/modern-caps-lock",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
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",
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,SAAS,UAAU,CAAC,MAAc;;IAIhC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAA,MAAA,SAAS,CAAC,aAAa,0CAAE,QAAQ,mCAAI,CAAC,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC1H,CAAC;AAOD,SAAS,YAAY;IACnB,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,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