Page 1 of 1

keyboard doesn't work on mac. after exporting..

PostPosted: Sat Sep 19, 2015 8:29 pm
by CodeArtOnline
i just exported my game . and when i played on pc . it worked good. but when i tryied to play on mac the keyboard didnt work.
whenever i press any key it just give buz sound like it does.. if you use mac you would know., does any have or had similar prob in the past. need help...

Re: keyboard doesn't work on mac. after exporting..

PostPosted: Wed Sep 30, 2015 10:49 pm
by bclikesyou
Bump because I'm having this issue too.

Plugged in my gamepad and it worked fine but just the error tone for anything on keyboard.

Re: keyboard doesn't work on mac. after exporting..

PostPosted: Thu Oct 01, 2015 1:27 am
by bclikesyou
I should also mention that I copied my exported nw.js file to a flash drive and then from there to my mac. Potential permission errors?

I also did a super basic .capx and that worked fine after I clicked on the window. However my game requests fullscreen and jumps in to it and I think that is where the issue is. Looking in to it now.

Re: keyboard doesn't work on mac. after exporting..

PostPosted: Thu Oct 01, 2015 2:58 am
by bclikesyou
Okay so it's definitely related to going full-screen on mac in nw.js with my build. Game works fine and great windowed but the moment I full-screen it, it completely ignores all keyboard input. I feel like it thinks the window isn't in the forground?

I have a fullscreen request at the beginning of my game. It can also be toggled via esc. Even with the request disabled at the beginning and full-screen being toggled later, it still ignores the keypad.

Again - game works fine windowed and full-screen with gamepad.

Re: keyboard doesn't work on mac. after exporting..

PostPosted: Thu Oct 01, 2015 11:48 am
by CodeArtOnline
Thanks Mann , i will definitely try this.. thanks :P

Re: keyboard doesn't work on mac. after exporting..

PostPosted: Thu Oct 01, 2015 1:51 pm
by bclikesyou
@CodeArtOnline Hey I was browsing through the manual and saw that the nw.js object has a "set always on top" action. So I *think* if you set this action to trigger/true only while in full-screen, it may work. This is assuming that nw.js doesn't think that the fullscreen is in focus/on top. I'm at work right now or I'd try it out :roll:

I can definitely try it out tonight and get back to you.

Re: keyboard doesn't work on mac. after exporting..

PostPosted: Fri Oct 02, 2015 3:58 am
by bclikesyou
Image

@CodeArtOnline This worked for me!

-Add the nw.js object to your layout
-Request "always on top" while in fullscreen.

What I have pictured is my fullscreen toggle (pressing ESC). I also have a fullscreen request during "on start of layout" on my very first layout. If you do the same, add the "always on top" request there as well.

Note: I had to click inside the window for it to recognize the keyboard. After that, worked great!

Re: keyboard doesn't work on mac. after exporting..

PostPosted: Sun Oct 04, 2015 5:11 pm
by CodeArtOnline
Man ur a wizard :P thankssss i will try it out.. but it will work i can sense it .. Thankssssss a tonn