3.0.0 beta (ZGE on Android)

Information and change log about the latest ZGameEditor release.

Moderator: Moderators

Post Reply
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Thanks Ville, it is working here again now.
Nice implementation BTW, I can add a menu or whatever on the back key,. . I'll post an update to BBH soon. Thanks again!
iterationGAMES.com
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Good that it works for both of you!
Kjell wrote:Couldn't recreate the error either, so not sure what went wrong the first time I tried.
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?
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

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?
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Keys should already be detected, although I haven't been able to test it. Have you tried with both uppercase and lowercase characters in KeyPress?
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Ville, I made a stupid mistake and used lower case for Keys. With upper case external keyboard detection works. That's great! How to recognize pressing keys with shift (upper case letters)?
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

shouldn't this work,.

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>
Got get a OTG adapter to test with,. .
iterationGAMES.com
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

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.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Hi Rado1

Please try todays version, it should trigger separate keypresses for uppercase and lowercase letters on Android.

About the EscapeToQuit-problem, how do you mean? Does it not exit the app when you press back?
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Hi,
VilleK wrote:Please try todays version, it should trigger separate keypresses for uppercase and lowercase letters on Android.
I'll try it tonight when I'm at home. Does it mean that KeyPress.Keys accepts also lower-case letters?
VilleK wrote:About the EscapeToQuit-problem, how do you mean? Does it not exit the app when you press back?
Exactly.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Hi Ville,

I tested separate keypresses for uppercase and lowercase letters on Android. Everything works fine. Could not KeyPress.Keys accept lowercase letters also on Windows?
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Rado1,
Rado1 wrote:KeyPress.Keys accept lowercase letters also on Windows?
The ASCII range representing lowercase letters ( 0x61 to 0x79 ) is used for other keys ( numpad / function-keys etc. ) on a regular keyboard.

http://msdn.microsoft.com/en-us/library ... 75731.aspx

K
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

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.
Post Reply