简体   繁体   English

检测并警告用户大写锁定已打开

[英]Detect and warn users about caps lock is on

How to implement to detecting and warning users when caps lock is on with (or not) tooltip style in typescript (angular 4.2.2)??如何在打字稿(角度 4.2.2)中使用(或不使用)工具提示样式启用大写锁定时检测和警告用户? Maybe with some keyup events, or like toUpperCase() in JS.也许有一些 keyup 事件,或者像 JS 中的toUpperCase()

How to implement to detecting and warning users when caps lock is on with (or not) tooltip style in typescript (angular 4.2.2)??如何在打字稿(角度 4.2.2)中使用(或不)工具提示样式启用大写锁定时检测和警告用户? Maybe with some keyup events, or like toUpperCase() in JS.也许有一些 keyup 事件,或者像 JS 中的toUpperCase()

How to implement to detecting and warning users when caps lock is on with (or not) tooltip style in typescript (angular 4.2.2)??如何在打字稿(角度 4.2.2)中使用(或不)工具提示样式启用大写锁定时检测和警告用户? Maybe with some keyup events, or like toUpperCase() in JS.也许有一些 keyup 事件,或者像 JS 中的toUpperCase()

How to implement to detecting and warning users when caps lock is on with (or not) tooltip style in typescript (angular 4.2.2)??如何在打字稿(角度 4.2.2)中使用(或不)工具提示样式启用大写锁定时检测和警告用户? Maybe with some keyup events, or like toUpperCase() in JS.也许有一些 keyup 事件,或者像 JS 中的toUpperCase()

@HostListener('window:click', ['$event'])
@HostListener('window:keydown', ['$event'])
@HostListener('window:keyup', ['$event'])
onCapsCheck(event: MouseEvent | KeyboardEvent) {
    this.capsOn = !!(event.getModifierState && event.getModifierState('CapsLock'));
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM