Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.javascript Subject: Re: CTRL use on canvas. Date: Thu, 12 Nov 2020 10:25:29 +0100 Lines: 30 Message-ID: References: <344fae3c-3474-487c-828d-1af5e497a32bn@googlegroups.com> <8c094ead-a23a-4757-bc47-63a9dcb75debo@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net prVTTGe3uFrmurkGkzqf5QN3YRnXxZ3Xhm8QJ8rQGP4487sLRU Cancel-Lock: sha1:Uepi7HUvvkGdAMU3vzSG85H+nUE= In-Reply-To: <8c094ead-a23a-4757-bc47-63a9dcb75debo@googlegroups.com> Xref: csiph.com comp.lang.javascript:39138 Jonas Thörnvall: > Den onsdag 11 november 2020 kl. 20:28:02 UTC+1 skrev Jonas Thörnvall: >> Den onsdag 11 november 2020 kl. 18:17:06 UTC+1 skrev Michael Haufe (TNO): >>> On Wed, 11 Nov 2020 00:30:32 -0800 (PST), Jonas Thörnvall wrote: >>>> I have started a "silly" project trying to simulate some sort of text >>>> editor/command cursor format on canvas. >>>> >>>> Shift seem to work implicity, chosing correct Charcode character, but >>>> CTRL charcode 17 just produce some rectangle symbol. >>> >>> Look at an ASCII table. What did you expect charcode 17 to display? >> >> Ok i was a bit tired this morning so forget that question, but i have a connected question, when i . and ,"echo" dot it correctly tells me keycode 188 and keycode 190. >> >> But what is echoed out is 3/4 and !/4 symbols, i know is is something with i am echoing wrong type of value. >> key = e.keyCode ? e.keyCode : e.which; >> character= String.fromCharCode(key); > > By the way > key = e.keyCode ? e.keyCode : e.which; > Is some heavy monkey grammer who come up with this shit? No, this is called a ternary operator and many languages have this. Also see -- Arno Welzel https://arnowelzel.de