Git Product home page Git Product logo

Comments (6)

uetchy avatar uetchy commented on May 25, 2024

I have same version of Polyglot and Safari however I couldn't reproduce the error.
What's your keyboard shortcuts settings?

This is my settings FYI:
screen shot 2017-09-29 at 10 55 37

from polyglot.

eisenhorn13 avatar eisenhorn13 commented on May 25, 2024

I have same key, but no keyboard modifier and that`s the key.

from polyglot.

uetchy avatar uetchy commented on May 25, 2024

It seems weird because I have no issue without keyboard modifiers.
Try to clear Key field and close the settings window, then put a new key to Key again and reload web pages.

from polyglot.

99sono avatar 99sono commented on May 25, 2024

Hi, this issue appears to be related to:
https://stackoverflow.com/questions/46268576/angular-4-safari-settings-object-without-keyvalue-property-defined

In my case, the function seems to be blowing up because the settings object has no KeyValue assigned to it.

Please be very careful with this extension.
If key settings are not configured, the following code should not be blowing up:
function handleKeypress(e) {
var applyMeta = settings.useMetaKey ? e.metaKey : true;
var applyShift = settings.useShiftKey ? e.shiftKey : true;
var applyCtrl = settings.useCtrlKey ? e.ctrlKey : true;
var applyAlt = settings.useAltKey ? e.altKey : true;
var applyKey = settings.keyValue.charCodeAt(0) === e.keyCode; <------ Unless you know that settings.keyValue is always set. In my Safaria configuration, when I check the polyglot configuration, there seems to be no key bound.

	if (applyMeta && applyShift && applyCtrl && applyAlt && applyKey) {
		e.preventDefault();
		getSelectedText();
	}
}

On the console, my settings object looks as follows:
{targetLanguage: "en", useMetaKey: true} = $1

Even after trying to select a key setting (e.g. command) the configuration for the keyValue continues empty.

In the end, to work-around the issue, it was necessary to:
Make the key configuration to use the key: Shift + T

By updating the primary key setting and the key value, it seems like the polyglot configuration became good again and the error has now gone away.

Thanks.

from polyglot.

uetchy avatar uetchy commented on May 25, 2024

Updated to v2.1.0

  • Suppress errors for invalid keyboard shortcuts

https://github.com/uetchy/Polyglot/releases/tag/v2.1.0

from polyglot.

uetchy avatar uetchy commented on May 25, 2024

See v2.2.0 for fixing this issue.

from polyglot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.