3.0.0 beta (ZGE on Android)
Moderator: Moderators
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Good that it works for both of you!
I think the error message you got will appear if you send in a model of another type than the one the function expects. So the model that the function received did not have the array in definitions. Perhaps that happened in your case?Kjell wrote:Couldn't recreate the error either, so not sure what went wrong the first time I tried.
Hi,
today I connected my Nexus 7 to PC keyboard and mouse by OTG cable. Everything worked fine and some applications (including Eater) can be used better than in conventional way - mouse is much more precise than finger touch and real keyboard is faster than virtual one.
Mouse is working fine with ZGE applications, but keyboard is not recognized. I realize this is not a usual case, but would it be possible to handle events from external (or maybe also virtual) keyboard by KeyPress on Android?
today I connected my Nexus 7 to PC keyboard and mouse by OTG cable. Everything worked fine and some applications (including Eater) can be used better than in conventional way - mouse is much more precise than finger touch and real keyboard is faster than virtual one.
Mouse is working fine with ZGE applications, but keyboard is not recognized. I realize this is not a usual case, but would it be possible to handle events from external (or maybe also virtual) keyboard by KeyPress on Android?
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
shouldn't this work,.
Got get a OTG adapter to test with,. .
Code: Select all
ZZDC<?xml version="1.0" encoding="iso-8859-1" ?>
<KeyPress Comment="hold shift key AND" CharCode="16">
<OnPressed>
<KeyPress Name="letter" Comment="press letter key" Keys="ABCDEFGHIJKLMNOPQRSTUVWXYZ">
<OnPressed>
<ZExpression>
<Expression>
<![CDATA[//uppercase letters (shifted)
int ascii=65+letter.KeyIndex;]]>
</Expression>
</ZExpression>
</OnPressed>
</KeyPress>
</OnPressed>
</KeyPress>
iterationGAMES.com
Jph, CharCode = 16 for shift is working only on PC, unfortunately not on Android. I tried to use also META_SHIFT_ON (1) and KEYCODE_SHIFT_LEFT (59) from SDK's KeyEvent class, but not working as well. Ville, could you please help?
Another problem I observed is that if ZApplication.EscapeToQuit is checked on, the application does not react to back button on Android as it previously did.
Another problem I observed is that if ZApplication.EscapeToQuit is checked on, the application does not react to back button on Android as it previously did.
Hi,
I'll try it tonight when I'm at home. Does it mean that KeyPress.Keys accepts also lower-case letters?VilleK wrote:Please try todays version, it should trigger separate keypresses for uppercase and lowercase letters on Android.
Exactly.VilleK wrote:About the EscapeToQuit-problem, how do you mean? Does it not exit the app when you press back?
Hi Rado1,
http://msdn.microsoft.com/en-us/library ... 75731.aspx
K
The ASCII range representing lowercase letters ( 0x61 to 0x79 ) is used for other keys ( numpad / function-keys etc. ) on a regular keyboard.Rado1 wrote:KeyPress.Keys accept lowercase letters also on Windows?
http://msdn.microsoft.com/en-us/library ... 75731.aspx
K
Thanks Kjell for explanation. I did not know that Keys are mapped directly to virtual-key codes. Implementation of KeyPress on Windows could provide a facade for handling lowercase and uppercase letters (pressing Shift key) on Windows anyway. But if it's too complicated or not conceptual or performance-decreasing, we can always use CharCode=16 to detect Shift, as Jph has shown in his example earlier. I just wanted to have the same code for Windows and Android.