Stweve's Recent Forum Activity

  • On further inspection, the above results remain true (on Mac nw.js) but JS event.keyCode is also incorrect.

    This is what is observed (on Mac nw.js) alltogether:

      C2's Keyboard.LastKeyCode is incorrect for numpad keys browser.execjs("event.code") is correct for numpad keys browser.execjs("event.keyCode") is incorrect for numpad keys.

    Example: LastKey2.zip

    Therefore, it seems that a workaround to properly detect numkeys on Mac nw.js is to leverage event.code from JavaScript and manually derive a keycode from that. Still not certain if this would occur in C3.

    Most importantly, I can also reproduce this on Mac outside of nw.js using the latest version of Chrome (62.0.3202.75)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This is easily one of the most interesting looking games I've come across this year.. perhaps the most interesting looking Construct game I've seen. I could just sit back and enjoy a full playthrough with the beautiful sounds. Bravo.

  • Also, would anyone that would be able to test this in Construct 3 Beta?

    (by downloading keytestcapx.zip then compiling it in njws for Mac and seeing if LastKeyCode is correct for numpad keys). Nwjs export is not permitted in the free public beta. I'd also love to test this with a temporary access code for C3 if one is available.

    Thanks!

    -Steve

  • I've encountered this also on 244. In my experience, the newer "smart" keyboards that connect directly (non bluetooth) also had the problem... so something seems off re: iOS keyboards altogether.

  • Posted a defect entry here. Wish me fortune.

  • Problem Description

    LastKeyCode reported incorrectly in nwjs on Mac for keys on the numeric pad.

    Example: Numeric Keypad key "1" is reported as code 49 and it should be 97.

    nwjs on Windows works fantastically and no browsers exhibit this issue on either Mac or Windows.

    This issue was initially discussed in post this post.

    Attach a Capx

    Link: keytestcapx.zip

    I don't see right off where to upload a .capx to this actual post, please see link above.

    Description of Capx

    In a text object, the .capx displays LastKeyCode when pressed and generates a Javascript alert of the same.

    In nwjs on Mac, LastKeyCode is incorrect for numkeys but the Java alert recognizes the key properly. The Java alert is there to effectively eliminate nwjs itself from the equation.

    Steps to Reproduce Bug

    • Export provided capx to nwjs on Mac.
    • Run the app; press a numpad key
    • The java alert is correct but the text object in the capx displays the wrong (non numpad) key.

    Observed Result

    LastKeyCode for numeric keys are reported incorrectly as their non-numeric counterparts

    Expected Result

    LastKeyCode should be correct for numkeys and consistent with the non-nwjs browser experience

    Affected Browsers

    Browsers do not exhibit the issue. Only nwjs on mac. nwjs on Windows works as expected.

    I don't see this issue on Safari, Chrome, IE, Edge, Firefox, FireFox Nightly.. everything is fine.

    Operating System and Service Pack

    MacOS El Capitan, Sierra, High Sierra. Occurs on both VM and real Mac hardware (Macbook Pro 2016)

    nwjs 21, 24, 25 have been tested.

    Construct 2 Version ID

    244, 247 beta

    Appreciate whomever checks this one out! This is, unfortunately, a showstopper for my particular application which is targeted primarily for Mac users... and it was determined late in the development cycle that nwjs was going to be a requirement. Thanks, -Steve

  • Aye. It is feeling buggish.. I don't have mac either, save virtual. I'll have this tested on a real mac (it will fail) and likely file a defect. Your avatar is pleasing.

  • Update:

    I installed nwjs 21.1 and the nwjs app launches without any required modification, but the same problem exists.

    The num keys are recognized as non-numeric keys in my nwjs app on Mac by Construct.

    Javascript key recognition works fine.

    Safari on Mac or nwjs on Windows don't have the problem.

    Anyone fancy a guess?

  • +1 for this feature. The use case is where you want to logically group different sets of actions for the same condition.

    In my predicament, there is a list of 12 actions for a condition. 3 of them are enhancements to the existing action list that are being tested but aren't quite there yet, so those 3 are disabled in order to work on them later. This is not as sensible workflow-wise without some sort of commenting capability.

  • Howdy CPeeps! I have a Construct 2 nwjs app on Mac (LastKeyCode) that will detect the numpad keys as non-numeric keys.

    So, pressing 5 on the numpad should detect 101 but will be seen as 53.

    Here's the interesting part:

      An html5 of the same project running in Safari on the same Mac does not have the problem. nwjs on Win64 does not have the problem.

    My favorite part:

    If I use Javascript within the Construct project to echo the key events as an alert:

    document.body.addEventListener('keyup', function (evt) {
            console.log(evt.code);
    });[/code:24nk49id]
    
    The java alert will echo [b]correctly [/b]on the Mac in nwjs, but LastKeyCode is still incorrect!!!
    Here's a test web app that alerts the Java KeyPress and displays LastKeyCode (should work fine): [url=http://www.divertigo.com/keycodehtml/]LINK[/url]
    Mac nwjs package for the same but the printed LastKeyCode should be wrong [url=http://www.divertigo.com/keycodehtml/lastkey.zip]Mac NWJS Package[/url]
    capx of the test (its two lines) [url=http://www.divertigo.com/keycodehtml/keytestcapx.zip]HERE[/url]
    
    Here's some information that may be relavant: 
    I'm building an nwjs app, then copying the files to a Mac share.  Because I'm experiencing the crash issue noted in [url=https://www.scirra.com/forum/built-macos-app-crashes-on-load_t193562]80bit's post[/url] I am having to copy the resources folder to a 0.25.3 (normal) package download from nwjs.io.
    
    Construct 2 r244 (Win64)
    nwjs / 0.24.0 and 0.25.0
    Mac clients: 10.11.6, have also tried High Sierra.
    
    I don't like the fact that I have to hodgepodge an nwjs package together to get this thing to run without crashing.. that could be part of the issue.. but it's awfully strange that LastKeyCode is tanking like that.  Curious if anyone has encountered something similar.
    
    While we're at it.. is anyone having success with nwjs on Mac without some sort of dorky workaround?
    Thanks! -Steve
Stweve's avatar

Stweve

Member since 14 Feb, 2014

None one is following Stweve yet!

Connect with Stweve