Rename specified key to modifier key

This commit is contained in:
sienori 2021-01-07 19:09:12 +09:00
parent a6db23f5fb
commit 56f85ef661
3 changed files with 17 additions and 20 deletions

View file

@ -95,17 +95,14 @@
"isDisabledInTextFieldsCaptionLabel": {
"message": "Don't display translation button or panel when selecting text in a text field."
},
"ifOnlyTranslateWhenShiftPressedLabel": {
"message": "Translate on specified key pressed"
"ifOnlyTranslateWhenModifierKeyPressedLabel": {
"message": "Translate on modifier key pressed"
},
"ifOnlyTranslateWhenShiftPressedCaptionLabel": {
"message": "Only display translation on Shift key pressed"
"ifOnlyTranslateWhenModifierKeyPressedCaptionLabel": {
"message": "Only display translation on specified modifier key pressed"
},
"specifiedKeyLabel": {
"message": "Specified Key"
},
"specifyKeyLabel": {
"message": "Specify Key"
"modifierKeyLabel": {
"message": "Modifier Key"
},
"shiftLabel": {
"message": "Shift"

View file

@ -38,9 +38,9 @@ const handleMouseUp = async e => {
if (isInContentEditable()) return;
}
if (getSettings("ifOnlyTranslateWhenShiftPressed")) {
const spKey = getSettings("specifiedKey")
switch(spKey){
if (getSettings("ifOnlyTranslateWhenModifierKeyPressed")) {
const modifierKey = getSettings("modifierKey");
switch (modifierKey) {
case "shift":
if (!e.shiftKey) return;
break;
@ -54,7 +54,7 @@ const handleMouseUp = async e => {
if (!e.metaKey) return;
break;
default:
break;
break;
}
}

View file

@ -88,20 +88,20 @@ export default [
]
},
{
title: "specifiedKeyLabel",
title: "modifierKeyLabel",
captions: [],
type: "none",
childElements:[
childElements: [
{
id: "ifOnlyTranslateWhenShiftPressed",
title: "ifOnlyTranslateWhenShiftPressedLabel",
captions: ["ifOnlyTranslateWhenShiftPressedCaptionLabel"],
id: "ifOnlyTranslateWhenModifierKeyPressed",
title: "ifOnlyTranslateWhenModifierKeyPressedLabel",
captions: ["ifOnlyTranslateWhenModifierKeyPressedCaptionLabel"],
type: "checkbox",
default: false
},
{
id: "specifiedKey",
title: "specifiedKeyLabel",
id: "modifierKey",
title: "modifierKeyLabel",
captions: [],
type: "select",
default: "shift",