You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Felipe Melo <fe...@snews.tv> on 2017/08/09 19:51:24 UTC

Ctrl+Z with caps lock on not working in Chrome

Hi,
 
I'm facing a problem when I try to undo/redo a text change inside a text
area or text input. Both Ctrl+Z and Ctrl+Y aren't working properly when caps
lock is on. If I turn off caps lock, it works.

The problem seems to occur only in Chrome. Using Firefox or Safari I did not
have any problems. I also tested in two different OS: Windows and Mac (same
problem in both).

I'm using Chrome version 60.0.3112.90, Flash Player version 26.0.0.151 and
Flex SDK 4.16.0.
 
Does anyone have an idea of how to solve this problem?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Harbs <ha...@gmail.com>.
I’m not sure if this is something that should be fixed on Adobe’s end. If they don’t want to fix it, we can change EditManager to accept both charCodes to deal with the difference in Chrome.

Let us know what you hear back from Adobe and create a JIRA if necessary. https://issues.apache.org/jira/browse/FLEX

Thanks,
Harbs

> On Aug 10, 2017, at 5:54 PM, Harbs <ha...@gmail.com> wrote:
> 
> The charCodes are not the same.
> 
> I just tested in Firefox and it’s 122 with caps lock on.
> 
> The Chrome Flash plugin is different and it’s probably dispatching different events.
> 
>> On Aug 10, 2017, at 5:35 PM, Felipe Melo <fe...@snews.tv> wrote:
>> 
>> Hi,
>> 
>> I have not tested the EditManager approach, but dispatching a new event with
>> the lower case char code solved the problem. I'm not happy with using this
>> kind of workaround but sometimes it is necessary :)
>> 
>> I just didn't get it why this problem only happens in Chrome, because the
>> char codes in all browsers are the same. At first, I thought that this was a
>> Flash Player problem, but the Adobe staff don't think so.
>> 
>> Anyway, thank you all for helping me.
>> 
>> - Felipe
>> 
>> 
>> 
>> --
>> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15693.html
>> Sent from the Apache Flex Users mailing list archive at Nabble.com.
> 


Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Felipe Melo <fe...@snews.tv>.
Yes, you're right. Everything is fine except when Ctrl/Cmd is pressed.

On Thu, Aug 10, 2017 at 2:06 PM Harbs [via Apache Flex Users] <
ml+s2333346n15702h0@n4.nabble.com> wrote:

> Sure. But when you press the key z with capslock and command/control, the
> charCode is for the little z rather than the big one. (Or at least it is in
> all browsers other than Chrome.)
>
> Clearer?
>
> > On Aug 10, 2017, at 7:25 PM, Felipe Melo <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=15702&i=0>> wrote:
> >
> > I'm sorry, I think my last message was still confusing. In Chrome, the
> > charCode of 'z' is 122 and 'Z' is 90, like the other browsers.
> >
> >
> >
> > --
> > View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15701.html
>
> > Sent from the Apache Flex Users mailing list archive at Nabble.com.
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15702.html
> To unsubscribe from Ctrl+Z with caps lock on not working in Chrome, click
> here
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=15676&code=ZmVsaXBlQHNuZXdzLnR2fDE1Njc2fC02MzY5MzMwNTM=>
> .
> NAML
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15705.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Harbs <ha...@gmail.com>.
Sure. But when you press the key z with capslock and command/control, the charCode is for the little z rather than the big one. (Or at least it is in all browsers other than Chrome.)

Clearer?

> On Aug 10, 2017, at 7:25 PM, Felipe Melo <fe...@snews.tv> wrote:
> 
> I'm sorry, I think my last message was still confusing. In Chrome, the
> charCode of 'z' is 122 and 'Z' is 90, like the other browsers.
> 
> 
> 
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15701.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Felipe Melo <fe...@snews.tv>.
I'm sorry, I think my last message was still confusing. In Chrome, the
charCode of 'z' is 122 and 'Z' is 90, like the other browsers.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15701.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Felipe Melo <fe...@snews.tv>.
No, I meant that for all browsers the charCode of 'z' will be 122 and 'Z'
will be 90. Chrome doesn't display any different value.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15700.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Harbs <ha...@gmail.com>.
The charCodes are not the same.

I just tested in Firefox and it’s 122 with caps lock on.

The Chrome Flash plugin is different and it’s probably dispatching different events.

> On Aug 10, 2017, at 5:35 PM, Felipe Melo <fe...@snews.tv> wrote:
> 
> Hi,
> 
> I have not tested the EditManager approach, but dispatching a new event with
> the lower case char code solved the problem. I'm not happy with using this
> kind of workaround but sometimes it is necessary :)
> 
> I just didn't get it why this problem only happens in Chrome, because the
> char codes in all browsers are the same. At first, I thought that this was a
> Flash Player problem, but the Adobe staff don't think so.
> 
> Anyway, thank you all for helping me.
> 
> - Felipe
> 
> 
> 
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15693.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Felipe Melo <fe...@snews.tv>.
Hi,

I have not tested the EditManager approach, but dispatching a new event with
the lower case char code solved the problem. I'm not happy with using this
kind of workaround but sometimes it is necessary :)

I just didn't get it why this problem only happens in Chrome, because the
char codes in all browsers are the same. At first, I thought that this was a
Flash Player problem, but the Adobe staff don't think so.

Anyway, thank you all for helping me.

- Felipe



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15693.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Harbs <ha...@gmail.com>.
Even simpler.

> On Aug 10, 2017, at 1:00 AM, Alex Harui <ah...@adobe.com.INVALID> wrote:
> 
> Or just dispatch the desired keyboard event when you see the undesired one.
> 
> HTH,
> -Alex
> 
> On 8/9/17, 2:47 PM, "Harbs" <harbs.lists@gmail.com <ma...@gmail.com>> wrote:
> 
>> You can try monkey-patching EditManager like so:
>> 
>> 					switch(event.charCode)
>> 					{
>> 						case 122:	// small z
>> 						case 90: // fixed caps lock problem
>> 							/* pre-Argo and on the mac then ignoreNextTextEvent */
>> 							if (!Configuration.versionIsAtLeast(10,1) &&
>> (Capabilities.os.search("Mac OS") > -1))
>> 								ignoreNextTextEvent = true;
>> 							if(event.shiftKey){
>> 								redo();
>> 								event.preventDefault();
>> 
>> 							} else {
>> 								undo();
>> 								event.preventDefault();
>> 							}
>> 							break;
>> 						case 121:	// small y
>> 						case 89: // fixed caps lock problem
>> 							ignoreNextTextEvent = true;
>> 							redo();
>> 							event.preventDefault();
>> 							break;
>> 
>>> On Aug 10, 2017, at 12:45 AM, Harbs <ha...@gmail.com> wrote:
>>> 
>>> And I assume that in other browsers it’s always 121 and 122. Right?
>>> 
>>>> On Aug 10, 2017, at 12:20 AM, Felipe Melo <fe...@snews.tv> wrote:
>>>> 
>>>> Thanks for your reply. I did what you suggested but everything seems
>>>> fine:
>>>> 
>>>> caps lock on: Y=89, Z=90
>>>> caps lock off: y=121, z=122
>>>> 
>>>> I have already confirmed that is not a problem in my code because I
>>>> was able
>>>> to reproduce the problem in the "Text Controls" example running at
>>>> 
>>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fflex.apa <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fflex.apa>
>>>> che.org <http://che.org/>%2Ftourdeflex%2F&data=02%7C01%7C%7Cb095298bf6d1465f2b3c08d4df7048
>>>> 24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636379120716199782&sdata
>>>> =EbYU6idsNIoF43URvxwBx6%2BfHQf%2FKHH1wA52kztjeQI%3D&reserved=0 (Spark
>>>> Framework Components > Visual
>>>> Components > Text Controls > Text Controls).
>>>> 
>>>> The simple code below also presents the same problem:
>>>> 
>>>> <?xml version="1.0"?>
>>>> <s:Application 
>>>> xmlns:fx="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F% <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%>
>>>> 2Fns.adobe.com <http://2fns.adobe.com/>%2Fmxml%2F2009&data=02%7C01%7C%7Cb095298bf6d1465f2b3c08d4d
>>>> f704824%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636379120716199782&
>>>> sdata=10uRSw9WbisF2Uf1sauxU5IHxLRyf9Nv5P7sp%2BzdSkI%3D&reserved=0"
>>>> xmlns:s="library://ns.adobe.com/flex/spark <library://ns.adobe.com/flex/spark>">
>>>>  <s:TextArea/>
>>>> </s:Application>
>>>> 
>>>> Thanks,
>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> View this message in context:
>>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-f <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-f>
>>>> lex-users.2333346.n4.nabble.com <http://lex-users.2333346.n4.nabble.com/>%2FCtrl-Z-with-caps-lock-on-not-working-i
>>>> n-Chrome-tp15676p15678.html&data=02%7C01%7C%7Cb095298bf6d1465f2b3c08d4df
>>>> 704824%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636379120716199782&s
>>>> data=jWcPFKS%2FBxy2YhMfF8zDuPNUXjSrUTqMJskTkk3vGak%3D&reserved=0
>>>> Sent from the Apache Flex Users mailing list archive at Nabble.com <http://nabble.com/>.


Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Or just dispatch the desired keyboard event when you see the undesired one.

HTH,
-Alex

On 8/9/17, 2:47 PM, "Harbs" <ha...@gmail.com> wrote:

>You can try monkey-patching EditManager like so:
>
>					switch(event.charCode)
>					{
>						case 122:	// small z
>						case 90: // fixed caps lock problem
>							/* pre-Argo and on the mac then ignoreNextTextEvent */
>							if (!Configuration.versionIsAtLeast(10,1) &&
>(Capabilities.os.search("Mac OS") > -1))
>								ignoreNextTextEvent = true;
>							if(event.shiftKey){
>								redo();
>								event.preventDefault();
>
>							} else {
>								undo();
>								event.preventDefault();
>							}
>							break;
>						case 121:	// small y
>						case 89: // fixed caps lock problem
>							ignoreNextTextEvent = true;
>							redo();
>							event.preventDefault();
>							break;
>
>> On Aug 10, 2017, at 12:45 AM, Harbs <ha...@gmail.com> wrote:
>> 
>> And I assume that in other browsers it’s always 121 and 122. Right?
>> 
>>> On Aug 10, 2017, at 12:20 AM, Felipe Melo <fe...@snews.tv> wrote:
>>> 
>>> Thanks for your reply. I did what you suggested but everything seems
>>>fine:
>>> 
>>> caps lock on: Y=89, Z=90
>>> caps lock off: y=121, z=122
>>> 
>>> I have already confirmed that is not a problem in my code because I
>>>was able
>>> to reproduce the problem in the "Text Controls" example running at
>>> 
>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fflex.apa
>>>che.org%2Ftourdeflex%2F&data=02%7C01%7C%7Cb095298bf6d1465f2b3c08d4df7048
>>>24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636379120716199782&sdata
>>>=EbYU6idsNIoF43URvxwBx6%2BfHQf%2FKHH1wA52kztjeQI%3D&reserved=0 (Spark
>>>Framework Components > Visual
>>> Components > Text Controls > Text Controls).
>>> 
>>> The simple code below also presents the same problem:
>>> 
>>> <?xml version="1.0"?>
>>> <s:Application 
>>>xmlns:fx="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%
>>>2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7C%7Cb095298bf6d1465f2b3c08d4d
>>>f704824%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636379120716199782&
>>>sdata=10uRSw9WbisF2Uf1sauxU5IHxLRyf9Nv5P7sp%2BzdSkI%3D&reserved=0"
>>> xmlns:s="library://ns.adobe.com/flex/spark">
>>>   <s:TextArea/>
>>> </s:Application>
>>> 
>>> Thanks,
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-f
>>>lex-users.2333346.n4.nabble.com%2FCtrl-Z-with-caps-lock-on-not-working-i
>>>n-Chrome-tp15676p15678.html&data=02%7C01%7C%7Cb095298bf6d1465f2b3c08d4df
>>>704824%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636379120716199782&s
>>>data=jWcPFKS%2FBxy2YhMfF8zDuPNUXjSrUTqMJskTkk3vGak%3D&reserved=0
>>> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>> 
>


Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Harbs <ha...@gmail.com>.
You can try monkey-patching EditManager like so:

					switch(event.charCode)
					{
						case 122:	// small z
						case 90: // fixed caps lock problem
							/* pre-Argo and on the mac then ignoreNextTextEvent */ 
							if (!Configuration.versionIsAtLeast(10,1) && (Capabilities.os.search("Mac OS") > -1)) 
								ignoreNextTextEvent = true;
							if(event.shiftKey){
								redo();
								event.preventDefault();

							} else {
								undo();
								event.preventDefault();
							}
							break;
						case 121:	// small y
						case 89: // fixed caps lock problem
							ignoreNextTextEvent = true;
							redo();
							event.preventDefault();
							break;

> On Aug 10, 2017, at 12:45 AM, Harbs <ha...@gmail.com> wrote:
> 
> And I assume that in other browsers it’s always 121 and 122. Right?
> 
>> On Aug 10, 2017, at 12:20 AM, Felipe Melo <fe...@snews.tv> wrote:
>> 
>> Thanks for your reply. I did what you suggested but everything seems fine:
>> 
>> caps lock on: Y=89, Z=90
>> caps lock off: y=121, z=122
>> 
>> I have already confirmed that is not a problem in my code because I was able
>> to reproduce the problem in the "Text Controls" example running at
>> http://flex.apache.org/tourdeflex/ (Spark Framework Components > Visual
>> Components > Text Controls > Text Controls).
>> 
>> The simple code below also presents the same problem:
>> 
>> <?xml version="1.0"?>
>> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>> xmlns:s="library://ns.adobe.com/flex/spark">
>>   <s:TextArea/>
>> </s:Application>
>> 
>> Thanks,
>> 
>> 
>> 
>> 
>> --
>> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15678.html
>> Sent from the Apache Flex Users mailing list archive at Nabble.com.
> 


Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Harbs <ha...@gmail.com>.
And I assume that in other browsers it’s always 121 and 122. Right?

> On Aug 10, 2017, at 12:20 AM, Felipe Melo <fe...@snews.tv> wrote:
> 
> Thanks for your reply. I did what you suggested but everything seems fine:
> 
> caps lock on: Y=89, Z=90
> caps lock off: y=121, z=122
> 
> I have already confirmed that is not a problem in my code because I was able
> to reproduce the problem in the "Text Controls" example running at
> http://flex.apache.org/tourdeflex/ (Spark Framework Components > Visual
> Components > Text Controls > Text Controls).
> 
> The simple code below also presents the same problem:
> 
> <?xml version="1.0"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
> xmlns:s="library://ns.adobe.com/flex/spark">
>    <s:TextArea/>
> </s:Application>
> 
> Thanks,
> 
> 
> 
> 
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15678.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Felipe Melo <fe...@snews.tv>.
Thanks for your reply. I did what you suggested but everything seems fine:

caps lock on: Y=89, Z=90
caps lock off: y=121, z=122

I have already confirmed that is not a problem in my code because I was able
to reproduce the problem in the "Text Controls" example running at
http://flex.apache.org/tourdeflex/ (Spark Framework Components > Visual
Components > Text Controls > Text Controls).

The simple code below also presents the same problem:

<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
    <s:TextArea/>
</s:Application>

Thanks,




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676p15678.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Ctrl+Z with caps lock on not working in Chrome

Posted by Harbs <ha...@gmail.com>.
Here’s what you can do to help diagnose the problem:

Set a keyDown event handler on the input and examine the event.charCode. Does it change if caps lock is on or off?

(It should be 122 for z and 121 for y.)

Thanks,
Harbs

> On Aug 9, 2017, at 10:51 PM, Felipe Melo <fe...@snews.tv> wrote:
> 
> Hi,
> 
> I'm facing a problem when I try to undo/redo a text change inside a text
> area or text input. Both Ctrl+Z and Ctrl+Y aren't working properly when caps
> lock is on. If I turn off caps lock, it works.
> 
> The problem seems to occur only in Chrome. Using Firefox or Safari I did not
> have any problems. I also tested in two different OS: Windows and Mac (same
> problem in both).
> 
> I'm using Chrome version 60.0.3112.90, Flash Player version 26.0.0.151 and
> Flex SDK 4.16.0.
> 
> Does anyone have an idea of how to solve this problem?
> 
> 
> 
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Ctrl-Z-with-caps-lock-on-not-working-in-Chrome-tp15676.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.