Last active
August 13, 2021 13:35
-
-
Save shmileee/ea84f45c29b962699289f3b62a0d4efc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Insert Ś | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author shmileee | |
// @match *://docs.google.com/spreadsheets/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
document.addEventListener('keydown', function(e){ | |
if(e.altKey && e.shiftKey){ | |
switch(e.code){ | |
case 'KeyS': | |
insertLetter(); | |
break; | |
} | |
} | |
}, true); | |
})(); | |
function insertLetter() { | |
var range = window.getSelection().getRangeAt(0); | |
range.deleteContents(); | |
var newNode = document.createTextNode("Ś"); | |
range.insertNode(newNode); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment