Re: [flexcoders] windows 8 store app onscreen keyboard invoking

2012-09-21 Thread Wouter Schreuders
ah ok. I set up a test where I added accessibility properties to the
sprite. Doesn't invoke the keyboard in metro :(

I've also traced out  Accessibility.active onto a textfield in metro and it
returns false.

Here's the added code:

private function init():void
{
drawSprite(); // Does not invoke Metro soft Keyboard
 drawSpriteWithEventHandler(); // Does not invoke Metro soft Keyboard
drawTextField(); // Does not invoke Metro soft Keyboard
 drawInputTextField(); // successfully invokes Metro soft Keyboard
 setTimeout(updateAccessibility, 2000);
 }
 private function updateAccessibility():void {
 console.text += Accessibility.active:  + Accessibility.active+'\n';
if(Accessibility.active) {
 Accessibility.updateProperties();
}
}

private function drawSpriteWithEventHandler():void
{
textInputEH = new Sprite();
 textInputEH.x  = 100;
textInputEH.y = 200;
var g:Graphics = textInputEH.graphics;
 g.beginFill(0x22ff00, 1);
g.drawRect(0,0,200,80);
g.endFill();
 addChild(textInputEH);
textInputEH.buttonMode = true;
textInputEH.addEventListener(MouseEvent.CLICK, function
(event:MouseEvent):void
 {
console.text += event.currentTarget+'\n';
} );
 addEventListener(Event.ADDED, addedHandler);
var accessProps:AccessibilityProperties = new AccessibilityProperties();
 accessibilityProperties = accessProps;
}
 private function addedHandler(event:Event):void {
console.text += addedHandler:  + name+'\n';
 var accessProps:AccessibilityProperties = new AccessibilityProperties();
accessProps.name = 'spriteWithAccessability';
 accessProps.description = 'textbox';
textInputEH.accessibilityProperties = accessProps;
 removeEventListener(Event.ADDED, addedHandler);
}



On 20 September 2012 23:26, Alex Harui aha...@adobe.com wrote:

 **


 I was more interested if you could get the Sprite to display the keyboard
 by adding accessibility properties to it.



 On 9/20/12 2:45 AM, Wouter Schreuders wschreud...@gmail.com wrote:






 Hi Alex

 Yep, focus definitely does go to the sprite and the stage's focus is set.
 I also outputted all the events that the textinput received (I've excluded
 some overly chatty ones like enterframe) Accessibly is enabled for the
 project and I've added the following to the MXML textInput which seem to no
 difference:

 accessibilityEnabled=true accessibilityName=textbox
 accessibilityDescription=textbox

 when I have a universal event listerner I get these events in both
 displayAsPassword enabled and disabled textInputs:

 preinitialize
 initialize
 resize
 creationComplete
 activate
 touchBegin
 touchRollOver
 touchOver
 removed
 focusIn
 touchMove
 removed
 touchMove
 touchEnd
 touchTap
 touchOut
 touchRollOut
 click




 On 19 September 2012 19:44, Alex Harui aha...@adobe.com wrote:

 stage.focus







 --
 Alex Harui
 Flex SDK Team
 Adobe Systems, Inc.
 http://blogs.adobe.com/aharui

  



Re: [flexcoders] windows 8 store app onscreen keyboard invoking

2012-09-21 Thread Alex Harui
If you turn off accessibility in the MXML app does displayAsPassword still make 
a difference?  I’m not really sure how to help here, just throwing out ideas.


On 9/21/12 3:11 AM, Wouter Schreuders wschreud...@gmail.com wrote:






ah ok. I set up a test where I added accessibility properties to the sprite. 
Doesn't invoke the keyboard in metro :(

I've also traced out  Accessibility.active onto a textfield in metro and it 
returns false.

Here's the added code:

private function init():void
{
drawSprite(); // Does not invoke Metro soft Keyboard
drawSpriteWithEventHandler(); // Does not invoke Metro soft Keyboard
drawTextField(); // Does not invoke Metro soft Keyboard
drawInputTextField(); // successfully invokes Metro soft Keyboard
setTimeout(updateAccessibility, 2000);
}
private function updateAccessibility():void {
console.text += Accessibility.active:  + Accessibility.active+'\n';
if(Accessibility.active) {
Accessibility.updateProperties();
}
}

private function drawSpriteWithEventHandler():void
{
textInputEH = new Sprite();
textInputEH.x  = 100;
textInputEH.y = 200;
var g:Graphics = textInputEH.graphics;
g.beginFill(0x22ff00, 1);
g.drawRect(0,0,200,80);
g.endFill();
addChild(textInputEH);
textInputEH.buttonMode = true;
textInputEH.addEventListener(MouseEvent.CLICK, function (event:MouseEvent):void
{
console.text += event.currentTarget+'\n';
} );
addEventListener(Event.ADDED, addedHandler);
var accessProps:AccessibilityProperties = new AccessibilityProperties();
accessibilityProperties = accessProps;
}
private function addedHandler(event:Event):void {
console.text += addedHandler:  + name+'\n';
var accessProps:AccessibilityProperties = new AccessibilityProperties();
accessProps.name = 'spriteWithAccessability';
accessProps.description = 'textbox';
textInputEH.accessibilityProperties = accessProps;
removeEventListener(Event.ADDED, addedHandler);
}



On 20 September 2012 23:26, Alex Harui aha...@adobe.com wrote:





I was more interested if you could get the Sprite to display the keyboard by 
adding accessibility properties to it.




On 9/20/12 2:45 AM, Wouter Schreuders wschreud...@gmail.com 
http://wschreud...@gmail.com  wrote:






Hi Alex

Yep, focus definitely does go to the sprite and the stage's focus is set. I 
also outputted all the events that the textinput received (I've excluded some 
overly chatty ones like enterframe) Accessibly is enabled for the project and 
I've added the following to the MXML textInput which seem to no difference:

accessibilityEnabled=true accessibilityName=textbox 
accessibilityDescription=textbox

when I have a universal event listerner I get these events in both 
displayAsPassword enabled and disabled textInputs:

preinitialize
initialize
resize
creationComplete
activate
touchBegin
touchRollOver
touchOver
removed
focusIn
touchMove
removed
touchMove
touchEnd
touchTap
touchOut
touchRollOut
click




On 19 September 2012 19:44, Alex Harui aha...@adobe.com 
http://aha...@adobe.com  wrote:
stage.focus






--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] windows 8 store app onscreen keyboard invoking

2012-09-20 Thread Wouter Schreuders
Hi Alex

Yep, focus definitely does go to the sprite and the stage's focus is set. I
also outputted all the events that the textinput received (I've excluded
some overly chatty ones like enterframe) Accessibly is enabled for the
project and I've added the following to the MXML textInput which seem to no
difference:

accessibilityEnabled=true accessibilityName=textbox
accessibilityDescription=textbox

when I have a universal event listerner I get these events in both
displayAsPassword enabled and disabled textInputs:

preinitialize
initialize
resize
creationComplete
activate
touchBegin
touchRollOver
touchOver
removed
focusIn
touchMove
removed
touchMove
touchEnd
touchTap
touchOut
touchRollOut
click




On 19 September 2012 19:44, Alex Harui aha...@adobe.com wrote:

 stage.focus


Re: [flexcoders] windows 8 store app onscreen keyboard invoking

2012-09-20 Thread Alex Harui
I was more interested if you could get the Sprite to display the keyboard by 
adding accessibility properties to it.


On 9/20/12 2:45 AM, Wouter Schreuders wschreud...@gmail.com wrote:






Hi Alex

Yep, focus definitely does go to the sprite and the stage's focus is set. I 
also outputted all the events that the textinput received (I've excluded some 
overly chatty ones like enterframe) Accessibly is enabled for the project and 
I've added the following to the MXML textInput which seem to no difference:

accessibilityEnabled=true accessibilityName=textbox 
accessibilityDescription=textbox

when I have a universal event listerner I get these events in both 
displayAsPassword enabled and disabled textInputs:

preinitialize
initialize
resize
creationComplete
activate
touchBegin
touchRollOver
touchOver
removed
focusIn
touchMove
removed
touchMove
touchEnd
touchTap
touchOut
touchRollOut
click




On 19 September 2012 19:44, Alex Harui aha...@adobe.com wrote:
stage.focus






--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] windows 8 store app onscreen keyboard invoking

2012-09-19 Thread Wouter Schreuders
Hi Alex

I'm using Flex SDK 4.5A (problem also occurs on 4.6)
The flash player is version 11.3.372.94 on windows 8 64 bit and as far as I
know IE have gone the same route as flash and rolled their own version of
the flash player inside the browser.

Metro officially supports flash sites that comply with their conditions as
set out here (
http://msdn.microsoft.com/en-us/library/ie/jj193557%28v=vs.85%29.aspx )

Microsoft's official policy on invoking the keyboard is that it must be
under the control of the user and can not be problematically invoked. The
way to invoke the keyboard is one of the following from this page (
http://msdn.microsoft.com/en-us/library/windows/apps/hh465404.aspx ) :

Accessibility properties from UI Automation (UIA)
User tap
Focus changes

from their docs : *UI Automation is the mechanism through which developers
communicate whether or not a particular UI element can receive text input.
You must ensure that the appropriate accessibility properties are set in
your apps so that the touch keyboard will know to appear when focus lands
on a specific UI element.*
*
*
Their own windows provided controls do this automatically otherwise inside
of your html you need to add the following:
div contentEditable=true role=textbox

So  that's how it works in html. I haven't found any documentation of help
on forums explaining how they decide when to bring up the keyboard in a
flash situation.

As you suggested I made an AS only site to see what works and what doesn't.
a normal sprite doesn't invoke the keyboard, neither does a sprite with a
mouse click listener. A normal textField doesn't invoke the keyboard but a
textfield with type set to TextFieldType.INPUT does invoke the keyboard
(which makes sense)

So somehow microsoft (I'm guessing) are inside of flash detecting what kind
of component recieved focus and if it's a editable textfield then it does
bring up the keyboard.

The intriguing thing is that for some reason when a spark textInput /
RichEditableText is set to displayAsPassword = true it DOES bring up the
keyboard so perhaps somewhere in the framework setting that flag causes the
component to somehow be perceived as a input component which quite strange
to me since I can't see why setting that condition would make any
difference.

Here's my test code:


package
{
import flash.display.Graphics;
import flash.display.Sprite;
 import flash.display.StageAlign;
import flash.display.StageQuality;
import flash.display.StageScaleMode;
 import flash.events.Event;
import flash.events.MouseEvent;
import flash.text.TextField;
 import flash.text.TextFieldType;
 public class CleanAsProject extends Sprite
 {
public function CleanAsProject()
{
 stage.scaleMode = StageScaleMode.NO_SCALE; //this stuff is required since
I'm working in flash builder and if you you don't put it in your graphics
scale is whack
 stage.align = StageAlign.TOP_LEFT;
stage.quality = StageQuality.HIGH;
 init();
}
 private function init():void
{
drawSprite(); // Does not invoke Metro soft Keyboard
 drawSpriteWithEventHandler(); // Does not invoke Metro soft Keyboard
drawTextField(); // Does not invoke Metro soft Keyboard
 drawInputTextField(); // successfully invokes Metro soft Keyboard
}
 private function drawTextField():void
{
var textField:TextField = new TextField;
 addChild(textField);
textField.x  = 100;
textField.y = 300;
 textField.height = 50;
textField.text = 'click me';
}
 private function drawInputTextField():void
{
 var textField:TextField = new TextField;
addChild(textField);
textField.x  = 100;
 textField.y = 350;
textField.height = 50;
textField.text = 'input text into me';
 textField.type = TextFieldType.INPUT;
textField.background = true;
}
 private function drawSpriteWithEventHandler():void
{
 var textInputEH:Sprite = new Sprite();
textInputEH.x  = 100;
 textInputEH.y = 200;
var g:Graphics = textInputEH.graphics;
g.beginFill(0x44ff00, 1);
 g.drawRect(0,0,200,80);
g.endFill();
addChild(textInputEH);
 textInputEH.buttonMode = true;
textInputEH.addEventListener(MouseEvent.CLICK, function
(event:MouseEvent):void
 {
trace(event.currentTarget);
} );
 }
  private function drawSprite():void
{
var textInput:Sprite = new Sprite();
 textInput.x  = 100;
textInput.y = 100;
var g:Graphics = textInput.graphics;
 g.beginFill(0xff9900, 1);
g.drawRect(0,0,200,80);
g.endFill();
 addChild(textInput);
}
 }
}


On 19 September 2012 07:59, Alex Harui aha...@adobe.com wrote:

 **


 I would break it down to an AS-only test where you set focus to a Sprite
 and see if you get the keyboard.

 Which version of player are you using?  Is metro officially supported?



 On 9/18/12 1:11 PM, Wouter Schreuders wschreud...@gmail.com wrote:






 Hi Alex

 The problem occurs with the spark RichEditableText therefore
 also textInput (not for MX:textInput). I set up a little test inside of
 windows 8 metro where traced out all the events for both a normal textInput
 and a textInput with displayAsPassword=true and they are firing identical
 events. The 

Re: [flexcoders] windows 8 store app onscreen keyboard invoking

2012-09-19 Thread Alex Harui
Are you sure focus went to the sprite?  Make sure stage.focus is set and you 
got FOCUS_IN and not FOCUS_OUT (and can get keyboard events).

It might be that there is a difference in the UIA in the player.  Did you link 
in the Flex accessibility code for the Spark components?


On 9/19/12 1:37 AM, Wouter Schreuders wschreud...@gmail.com wrote:






Hi Alex

I'm using Flex SDK 4.5A (problem also occurs on 4.6)
The flash player is version 11.3.372.94 on windows 8 64 bit and as far as I 
know IE have gone the same route as flash and rolled their own version of the 
flash player inside the browser.

Metro officially supports flash sites that comply with their conditions as set 
out here ( 
http://msdn.microsoft.com/en-us/library/ie/jj193557%28v=vs.85%29.aspx )

Microsoft's official policy on invoking the keyboard is that it must be under 
the control of the user and can not be problematically invoked. The way to 
invoke the keyboard is one of the following from this page ( 
http://msdn.microsoft.com/en-us/library/windows/apps/hh465404.aspx ) :

Accessibility properties from UI Automation (UIA)
User tap
Focus changes

from their docs : UI Automation is the mechanism through which developers 
communicate whether or not a particular UI element can receive text input. You 
must ensure that the appropriate accessibility properties are set in your apps 
so that the touch keyboard will know to appear when focus lands on a specific 
UI element.

Their own windows provided controls do this automatically otherwise inside of 
your html you need to add the following:
div contentEditable=true role=textbox

So  that's how it works in html. I haven't found any documentation of help on 
forums explaining how they decide when to bring up the keyboard in a flash 
situation.

As you suggested I made an AS only site to see what works and what doesn't. a 
normal sprite doesn't invoke the keyboard, neither does a sprite with a mouse 
click listener. A normal textField doesn't invoke the keyboard but a textfield 
with type set to TextFieldType.INPUT does invoke the keyboard (which makes 
sense)

So somehow microsoft (I'm guessing) are inside of flash detecting what kind of 
component recieved focus and if it's a editable textfield then it does bring up 
the keyboard.

The intriguing thing is that for some reason when a spark textInput / 
RichEditableText is set to displayAsPassword = true it DOES bring up the 
keyboard so perhaps somewhere in the framework setting that flag causes the 
component to somehow be perceived as a input component which quite strange to 
me since I can't see why setting that condition would make any difference.

Here's my test code:


package
{
import flash.display.Graphics;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageQuality;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.text.TextFieldType;
public class CleanAsProject extends Sprite
{
public function CleanAsProject()
{
stage.scaleMode = StageScaleMode.NO_SCALE; //this stuff is required since I'm 
working in flash builder and if you you don't put it in your graphics scale is 
whack
stage.align = StageAlign.TOP_LEFT;
stage.quality = StageQuality.HIGH;
init();
}
private function init():void
{
drawSprite(); // Does not invoke Metro soft Keyboard
drawSpriteWithEventHandler(); // Does not invoke Metro soft Keyboard
drawTextField(); // Does not invoke Metro soft Keyboard
drawInputTextField(); // successfully invokes Metro soft Keyboard
}
private function drawTextField():void
{
var textField:TextField = new TextField;
addChild(textField);
textField.x  = 100;
textField.y = 300;
textField.height = 50;
textField.text = 'click me';
}
private function drawInputTextField():void
{
var textField:TextField = new TextField;
addChild(textField);
textField.x  = 100;
textField.y = 350;
textField.height = 50;
textField.text = 'input text into me';
textField.type = TextFieldType.INPUT;
textField.background = true;
}
private function drawSpriteWithEventHandler():void
{
var textInputEH:Sprite = new Sprite();
textInputEH.x  = 100;
textInputEH.y = 200;
var g:Graphics = textInputEH.graphics;
g.beginFill(0x44ff00, 1);
g.drawRect(0,0,200,80);
g.endFill();
addChild(textInputEH);
textInputEH.buttonMode = true;
textInputEH.addEventListener(MouseEvent.CLICK, function (event:MouseEvent):void
{
trace(event.currentTarget);
} );
}
private function drawSprite():void
{
var textInput:Sprite = new Sprite();
textInput.x  = 100;
textInput.y = 100;
var g:Graphics = textInput.graphics;
g.beginFill(0xff9900, 1);
g.drawRect(0,0,200,80);
g.endFill();
addChild(textInput);
}
}
}


On 19 September 2012 07:59, Alex Harui aha...@adobe.com wrote:





I would break it down to an AS-only test where you set focus to a Sprite and 
see if you get the keyboard.

Which version of player are you using?  Is metro officially supported?




On 9/18/12 1:11 PM, Wouter Schreuders 

Re: [flexcoders] windows 8 store app onscreen keyboard invoking

2012-09-18 Thread Alex Harui
Spark or MX?  If Spark, then maybe they can’t handle non-TextFields getting 
focus?


On 9/17/12 8:33 AM, Wouter Schreuders wschreud...@gmail.com wrote:






Hi All

I'm busy testing our application in the windows 8 store app browser and I've 
noticed that the keyboard automatically appears when you click on a flash text 
input but not when you click on a flex text input. I'm guessing that MS are 
doing some kind of event detection which invokes the onscreen keyboard but that 
they didn't do the same thing for flex text inputs. I've also checked it seems 
that one cannot invoke the keyboard manually with javascript.

Has anyone run into this problem before and found a solution? I've also noticed 
that it DOES bring up the keyboard if you have set displayAsPassword=true for 
some reason.

Has anyone got any idea why this is happening and how I can work around/solve 
it?

Thanks

Wouter






--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] windows 8 store app onscreen keyboard invoking

2012-09-18 Thread Wouter Schreuders
Hi Alex

The problem occurs with the spark RichEditableText therefore also textInput
(not for MX:textInput). I set up a little test inside of windows 8 metro
where traced out all the events for both a normal textInput and a textInput
with displayAsPassword=true and they are firing identical events. The one
with displayAsPassword=true invokes the keyboard perfectly everytime.
I've also extended the RichEditableText class and overwritten some of the
methods that are dependant on the displayAsPassword flag to see if that
makes any difference but no luck.


On 18 September 2012 21:50, Alex Harui aha...@adobe.com wrote:

 **


 Spark or MX?  If Spark, then maybe they can’t handle non-TextFields
 getting focus?



 On 9/17/12 8:33 AM, Wouter Schreuders wschreud...@gmail.com wrote:






 Hi All

 I'm busy testing our application in the windows 8 store app browser and
 I've noticed that the keyboard automatically appears when you click on a
 flash text input but not when you click on a flex text input. I'm guessing
 that MS are doing some kind of event detection which invokes the onscreen
 keyboard but that they didn't do the same thing for flex text inputs. I've
 also checked it seems that one cannot invoke the keyboard manually with
 javascript.

 Has anyone run into this problem before and found a solution? I've also
 noticed that it DOES bring up the keyboard if you have set
 displayAsPassword=true for some reason.

 Has anyone got any idea why this is happening and how I can work
 around/solve it?

 Thanks

 Wouter






 --
 Alex Harui
 Flex SDK Team
 Adobe Systems, Inc.
 http://blogs.adobe.com/aharui

  



Re: [flexcoders] windows 8 store app onscreen keyboard invoking

2012-09-18 Thread Alex Harui
I would break it down to an AS-only test where you set focus to a Sprite and 
see if you get the keyboard.

Which version of player are you using?  Is metro officially supported?


On 9/18/12 1:11 PM, Wouter Schreuders wschreud...@gmail.com wrote:






Hi Alex

The problem occurs with the spark RichEditableText therefore also textInput 
(not for MX:textInput). I set up a little test inside of windows 8 metro where 
traced out all the events for both a normal textInput and a textInput with 
displayAsPassword=true and they are firing identical events. The one with 
displayAsPassword=true invokes the keyboard perfectly everytime. I've also 
extended the RichEditableText class and overwritten some of the methods that 
are dependant on the displayAsPassword flag to see if that makes any difference 
but no luck.


On 18 September 2012 21:50, Alex Harui aha...@adobe.com wrote:





Spark or MX?  If Spark, then maybe they can’t handle non-TextFields getting 
focus?




On 9/17/12 8:33 AM, Wouter Schreuders wschreud...@gmail.com 
http://wschreud...@gmail.com  wrote:






Hi All

I'm busy testing our application in the windows 8 store app browser and I've 
noticed that the keyboard automatically appears when you click on a flash text 
input but not when you click on a flex text input. I'm guessing that MS are 
doing some kind of event detection which invokes the onscreen keyboard but that 
they didn't do the same thing for flex text inputs. I've also checked it seems 
that one cannot invoke the keyboard manually with javascript.

Has anyone run into this problem before and found a solution? I've also noticed 
that it DOES bring up the keyboard if you have set displayAsPassword=true for 
some reason.

Has anyone got any idea why this is happening and how I can work around/solve 
it?

Thanks

Wouter






--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


[flexcoders] windows 8 store app onscreen keyboard invoking

2012-09-17 Thread Wouter Schreuders
Hi All

I'm busy testing our application in the windows 8 store app browser and
I've noticed that the keyboard automatically appears when you click on a
flash text input but not when you click on a flex text input. I'm guessing
that MS are doing some kind of event detection which invokes the onscreen
keyboard but that they didn't do the same thing for flex text inputs. I've
also checked it seems that one cannot invoke the keyboard manually with
javascript.

Has anyone run into this problem before and found a solution? I've also
noticed that it DOES bring up the keyboard if you have
set displayAsPassword=true for some reason.

Has anyone got any idea why this is happening and how I can work
around/solve it?

Thanks

Wouter