Coder Social home page Coder Social logo

Running in background about pianoputer HOT 4 OPEN

kosirm avatar kosirm commented on June 6, 2024
Running in background

from pianoputer.

Comments (4)

kosirm avatar kosirm commented on June 6, 2024

Oh sorry... I just found line 328 in pianoputer_stereo.py # todo if the window lost focus cant hear the SOUND
So it's on your todo list already 👍 , hopefully you will implement solution soon. Thanks!

from pianoputer.

kosirm avatar kosirm commented on June 6, 2024

I've found WINDOWEVENT_FOCUS_LOST event attribute on pygame.display.set_mode but I have no idea how to use it or if it is usable at all...

from pianoputer.

yoyoberenguer avatar yoyoberenguer commented on June 6, 2024

Hi Kosirm,

Yes you could do a fix with WINDOWEVENT_FOCUS_LOST, therefore there is an easier way.
Use pygame.event.set_grab(True) just before the WHILE loop in the code.

The focus event allow pygame to control the keyboard and mouse directly, meaning that pygame will be the first to collect your keyboard/mouse inputs while the program is running

To switch between your windows, use ALT-TAB or exit pianocumputer.
Kind Regards

from pianoputer.

kosirm avatar kosirm commented on June 6, 2024

Thank you so much! I will do this now... BR

from pianoputer.

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.