js_lis 1.0.19 → 1.0.21

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.
Files changed (2) hide show
  1. package/VirtualKeyboard.js +13 -11
  2. package/package.json +1 -1
@@ -144,9 +144,11 @@ export class VirtualKeyboard {
144
144
  keyElement.className += ' space';
145
145
  }
146
146
 
147
- if (key === 'backspace') {
148
- keyElement.className += ' backspacew';
149
- }
147
+ if (key === 'backspace' || key === 'Backspace') {
148
+ keyElement.className += ' backspacew';
149
+ keyElement.innerHTML = '<i class="fa fa-backspace"></i>';
150
+ }
151
+
150
152
 
151
153
  keyElement.onclick = (e) => {
152
154
  e.preventDefault();
@@ -296,7 +298,7 @@ export class VirtualKeyboard {
296
298
  Object.values(this.ThaiAlphabetShift).includes(currentChar)
297
299
  ) {
298
300
  // เปลี่ยนกลับเมื่อปิด Shift
299
- const originalKey = Object.keys(ThaiAlphabetShift).find(
301
+ const originalKey = Object.keys(this.ThaiAlphabetShift).find(
300
302
  (key) => this.ThaiAlphabetShift[key] === currentChar
301
303
  );
302
304
  if (originalKey) {
@@ -307,18 +309,18 @@ export class VirtualKeyboard {
307
309
 
308
310
  if (
309
311
  this.capsLockActive &&
310
- this.currentLayout === "th" &&
312
+ this.currentLayout === "en" &&
311
313
  this.EngAlphabetShift[currentChar]
312
314
  ) {
313
315
  key.textContent = this.EngAlphabetShift[currentChar];
314
316
  key.dataset.key = this.EngAlphabetShift[currentChar];
315
317
  } else if (
316
318
  !this.capsLockActive &&
317
- this.currentLayout === "th" &&
319
+ this.currentLayout === "en" &&
318
320
  Object.values(this.EngAlphabetShift).includes(currentChar)
319
321
  ) {
320
322
  // เปลี่ยนกลับเมื่อปิด Shift
321
- const originalKey = Object.keys(EngAlphabetShift).find(
323
+ const originalKey = Object.keys(this.EngAlphabetShift).find(
322
324
  (key) => this.EngAlphabetShift[key] === currentChar
323
325
  );
324
326
  if (originalKey) {
@@ -362,7 +364,7 @@ export class VirtualKeyboard {
362
364
  Object.values(this.ThaiAlphabetShift).includes(currentChar)
363
365
  ) {
364
366
  // เปลี่ยนกลับเมื่อปิด Shift
365
- const originalKey = Object.keys(ThaiAlphabetShift).find(
367
+ const originalKey = Object.keys(this.ThaiAlphabetShift).find(
366
368
  (key) => this.ThaiAlphabetShift[key] === currentChar
367
369
  );
368
370
  if (originalKey) {
@@ -373,18 +375,18 @@ export class VirtualKeyboard {
373
375
 
374
376
  if (
375
377
  this.shiftActive &&
376
- this.currentLayout === "th" &&
378
+ this.currentLayout === "en" &&
377
379
  this.EngAlphabetShift[currentChar]
378
380
  ) {
379
381
  key.textContent = this.EngAlphabetShift[currentChar];
380
382
  key.dataset.key = this.EngAlphabetShift[currentChar];
381
383
  } else if (
382
384
  !this.shiftActive &&
383
- this.currentLayout === "th" &&
385
+ this.currentLayout === "en" &&
384
386
  Object.values(this.EngAlphabetShift).includes(currentChar)
385
387
  ) {
386
388
  // เปลี่ยนกลับเมื่อปิด Shift
387
- const originalKey = Object.keys(EngAlphabetShift).find(
389
+ const originalKey = Object.keys(this.EngAlphabetShift).find(
388
390
  (key) => this.EngAlphabetShift[key] === currentChar
389
391
  );
390
392
  if (originalKey) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js_lis",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"