Rename specified key to modifier key
This commit is contained in:
parent
a6db23f5fb
commit
56f85ef661
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -88,20 +88,20 @@ export default [
|
|||
]
|
||||
},
|
||||
{
|
||||
title: "specifiedKeyLabel",
|
||||
title: "modifierKeyLabel",
|
||||
captions: [],
|
||||
type: "none",
|
||||
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",
|
||||
|
|
Loading…
Reference in a new issue