Skip to content

dabruhce/game-screen-capture

 
 

Repository files navigation

Electron Application with Overlay Window

This is an Electron application that creates two separate windows: a main application window and an overlay window. The main window is positioned on the left half of the screen, and the overlay window is positioned at the top right, with dimensions of 200x200 pixels.

Features

  • Main Window: A standard Electron browser window that can be used for your primary application interface.
  • Overlay Window: A small, transparent, frameless window that is always on top. It can be moved independently and is positioned at the top right of the screen. Overlay can be included in screenshot by selecting screen 1
  • Keyboard Events: Listens for key events using the uiohook-napi library, triggering actions like screenshots or creating a match when specific keys are held down.

Installation

  1. Clone the Repository:

    git clone https://github.com/dabruhce/game-screen-capture.git
    cd game-screen-capture
  2. Install Dependencies:

    npm install
  3. Run the Application:

    npm start

Usage

  • On startup, the application will create two windows:

    • Main Window: Positioned on the left half of the screen.
    • Overlay Window: Positioned at the top right of the screen at coordinates (880, 0), with a size of 200x200 pixels.
  • Key Bindings:

    • Hold the Tab key for 300ms to trigger a screenshot action.
    • Hold the Backspace key for 300ms to trigger the creation of a match.

Customization

  • Changing Window Positions and Sizes:

    • Modify the createWindow and createOverlayWindow functions in main.js to adjust the positions and sizes of the main and overlay windows.
  • Overlay Content:

    • Edit overlay.html to customize the content displayed in the overlay window.

Dependencies

  • Electron - Build cross-platform desktop apps with JavaScript, HTML, and CSS.
  • uiohook-napi - Native Node.js module for global keyboard and mouse hooking.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an issue if you have any suggestions or improvements.

Acknowledgements

  • Thanks to the creators of Electron and uiohook-napi for making this project possible. Forked from JohnJunior/electron-desktop-capturing.

About

This is a minimal Electron application with a screen picker.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 75.0%
  • HTML 14.5%
  • CSS 10.5%