1
0
mirror of https://github.com/keeweb/keeweb.git synced 2024-06-25 07:37:46 +02:00

using batch text entry

This commit is contained in:
antelle 2021-01-31 12:27:20 +01:00
parent ef354fb8af
commit 4e58285cc2
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
3 changed files with 25 additions and 20 deletions

View File

@ -210,9 +210,11 @@ function kbdModifier(modifiers) {
}
function kbdTextAsKeys(str, modifiers) {
const typer = getAutoType();
const modifier = kbdModifier(modifiers);
let ix = 0;
const typer = getAutoType();
const tx = typer.beginBatchTextEntry();
try {
for (const kc of typer.osKeyCodesForChars(str)) {
const char = str[ix++];
let effectiveModifier = modifier;
@ -231,6 +233,9 @@ function kbdTextAsKeys(str, modifiers) {
typer.keyMoveWithModifier(false, kc.modifier);
}
}
} finally {
tx.done();
}
}
function startListener() {

4
package-lock.json generated
View File

@ -2062,8 +2062,8 @@
}
},
"@keeweb/keeweb-native-modules": {
"version": "https://github.com/keeweb/keeweb-native-modules/releases/download/0.7.11/keeweb-native-modules.tgz",
"integrity": "sha512-EPK6HlxCPvkZJlHLknr8HIxvmJ9vXStI2H16lYdJAWX3GytlN6DIEnSLo25mo9uKCYhHjOyNwxkXfi0UppdZmg=="
"version": "https://github.com/keeweb/keeweb-native-modules/releases/download/0.7.12/keeweb-native-modules.tgz",
"integrity": "sha512-56LkWAQUeyTUQyLzy3cdtPPrhqZ5mfcLsyO53245hO1X4KBoHmec1gYNu9lvNQrFs/7okhMFHdjCHOcyBfeCkQ=="
},
"@polka/url": {
"version": "1.0.0-next.11",

View File

@ -16,7 +16,7 @@
"@babel/plugin-proposal-optional-chaining": "^7.12.7",
"@babel/preset-env": "^7.12.11",
"@fortawesome/fontawesome-free": "^5.15.2",
"@keeweb/keeweb-native-modules": "https://github.com/keeweb/keeweb-native-modules/releases/download/0.7.11/keeweb-native-modules.tgz",
"@keeweb/keeweb-native-modules": "https://github.com/keeweb/keeweb-native-modules/releases/download/0.7.12/keeweb-native-modules.tgz",
"adm-zip": "^0.5.2",
"argon2-browser": "1.15.3",
"autoprefixer": "^10.2.4",