Git Product home page Git Product logo

Comments (13)

375gnu avatar 375gnu commented on July 1, 2024

What Lua version do you use?

goto is a keyword in Lua 5.2 so the method was renamed to gotoobject, but it's still available as goto on Lua 5.1 and earlier.

So that I assume that you use Lua 5.2 or 5.3 that might dropped automatic loading of io library as it did for coroutines.

from celestia.

375gnu avatar 375gnu commented on July 1, 2024

@GottfriedSp please test #65

from celestia.

GottfriedSp avatar GottfriedSp commented on July 1, 2024

Ok, I try the gotoobject.

The other thing I found in celx.cpp line 744, this i changed to:
if(strcmp(c_p, "y") == 0 || strcmp(c_p, "Y") == 0)
The qt sends from CelestiaGlWidget::keyPressEvent line 535 the key 'Y':
appCore->charEntered('Y');
Now it works perfectly.
From Windows native the key 'y' comes from MainWindowProc() line 4291:
appCore->charEntered(utf8CharCode, modifiers);

I added the commit into my Pull request. (Each new Push from my local repository added to the Pull request to the open Pull request here, and I don't know why)

Current Lua: 5.1.5
I try to update to Lua 5.3.4 but I think this works also.

from celestia.

375gnu avatar 375gnu commented on July 1, 2024

If you use windows, then the only supported Lua so far is 5.1. Only Unix builds support Lua 5.2 & 5.3.

That's quite strange that you have io==nil with 5.1, my Celestia 1.6.2 linked against Lua 5.1 works with your script.

from celestia.

GottfriedSp avatar GottfriedSp commented on July 1, 2024

Ok, maybe the Qt 5.6.3 for windows.
When I click into screen and press ENTER and then press the keys "p r o x i m a" I see in the screen the word "prOXIma" - see screenshot below.
proxima
It works with both, my changes and the changes #65
The system cyllene looks like this picture:
cyllene

I have Qt5.6.3 windows 64-bit with platformtoolset v140 and 32-bit with platformtoolset v140_xp
Qt with msvc2015 compiler (visual studio and qt-creator)
I build the lua 5.1 and 5.3 with visual studio 2015 as static lib and the 5.3 also works with the current celestia 1.7.0

from celestia.

GottfriedSp avatar GottfriedSp commented on July 1, 2024

The io==nil comes from the upper case 'Y' even if i press 'y'

from celestia.

GottfriedSp avatar GottfriedSp commented on July 1, 2024

You're right, I tested Lua 5.3 with windows and celestia crashes -> switch back to 5.1 for windows.

from celestia.

375gnu avatar 375gnu commented on July 1, 2024

So, let's summarize:

  1. Qt related code sends incorrect characters (uppercased), so your dcaa0a7 just workarounds the problem in one particular case. We need a better fix.
  2. celestia:requestsystemaccess() should either abort script if 'y' wasn't pressed or return false so script author can process it.

from celestia.

375gnu avatar 375gnu commented on July 1, 2024

1b1781d (partially) and 0c6786b should be reverted as they are ugly hack and cause this issue.

from celestia.

GottfriedSp avatar GottfriedSp commented on July 1, 2024

But the check for 'y' or 'Y' should be ok if the caps lock is pressed or the user click the key 'Y'.
The other code also should be changed, I see for VK_C:
else if (e->modifiers().testFlag(Qt::ShiftModifier)) appCore->charEntered('C'); else appCore->charEntered('c'); break;
But this is not clean code to add this for each keystroke, I look for a better solution for that.

from celestia.

GottfriedSp avatar GottfriedSp commented on July 1, 2024

Ah, ok i see, the defines with hexadecimal values.
I think the cases with the same functionality can be blocked together

from celestia.

Alexell avatar Alexell commented on July 1, 2024

Partially fixed?

from celestia.

375gnu avatar 375gnu commented on July 1, 2024

Yes, only partially. Now if you press 'y' then celx code receives 'y' not 'Y', but we still need to properly fix case when 'Y' is pressed (trivially) and make celestia:requestsystemaccess() return result (not so easy because of asynchronous nature of how interaction with user is implemented).

from celestia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.