Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
fnkg-keytranslator
Advanced tools
Readme
Translates the KeyboardEvent.key code (which is the "offical" successor of KeyboardEvent.keyCode) to value common on all browsers.
The KeyboardEvent.keyCode is deprecated according to this source: https://developer.mozilla.org/de/docs/Web/API/KeyboardEvent/keyCode. If you are using typescript and are using the keyCode you are probably seeing the 'keyCode is deprecated' message'.
The problem with using the successor KeyboardEvent.key, is that the codes differ among browsers (see https://caniuse.com/#search=KeyboardEvent.key) This package provides the function KeyTranslate which will translate any given Event parameter to a uniform 'key' result which conforms to this standard: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values
The 'key' value can then be used in conjunction with the package ts-key-enum : https://www.npmjs.com/package/ts-key-enum.
import { Key } from 'ts-key-enum';
import { KeyTranslate } from 'fnkg-keytranslator';
...
onKeydown(event: KeyboardEvent) {
const tkey = KeyTranslate(event);
switch (tkey) {
case Key.ArrowUp:
// do something when user pressed the directional up key.
console.log('up');
break;
case Key.ArrowDown:
// do something when user pressed the directional down key.
console.log('down');
break;
}
}
FAQs
Translator for KeyboardEvent.key variants of different browsers
The npm package fnkg-keytranslator receives a total of 0 weekly downloads. As such, fnkg-keytranslator popularity was classified as not popular.
We found that fnkg-keytranslator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.