MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    touch screen

    Scheduled Pinned Locked Moved Unsolved Requests
    6 Posts 3 Posters 2.1k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      Artech
      last edited by

      Re: touch screen

      you want to display a cursor on your mirror or you you want to do a touchscreen miror?

      1 Reply Last reply Reply Quote 0
      • T Offline
        tpot
        last edited by

        both basically if you get the mouse working then touchscreen works. But really i want to know how to get the mouse to show up on the screen

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @tpot
          last edited by

          @tpot edit the main.css and comment out this

          html {
            cursor: none;   // < ---
            overflow: hidden;
            background: #000;
          }
          

          I don’t know if this will override if placed in custom.css

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          T 1 Reply Last reply Reply Quote 0
          • T Offline
            tpot @sdetweil
            last edited by

            @sdetweil thanks man cant believe i missed that code thanks alot :)

            1 Reply Last reply Reply Quote 0
            • T Offline
              tpot
              last edited by

              this is probably a really easy thing but i cant find out how to do it. How do you create a clickable button ?

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @tpot
                last edited by

                @tpot in html this is < button id=“xyz” onclick=“someroutine”>

                someroutine is in your javascript module.js handler

                someroutine: function(){
                the ‘this’ variable points to the button object that caused the call
                this.id equals ‘xyz’
                }

                you can also create the button with code (in the getDom function)

                let button = document.createElement(“button”)
                button.id=‘xyz’;
                button.addEventListener(‘click’,self.someroutine)
                wrapper.appendChild(button)

                here is a routine from another module to create a button object with an icon, and some data (src attribute) to be used when the button is pushed

                	createVideoButton: function(video, height, width) {
                			let button = document.createElement("button");
                			button.className = "button";
                		    button.setAttribute("data-video-src", "modules/" + self.name + "/" + this.config.videoDir + "/" + video);
                		    button.addEventListener("click", self.swapVideo);
                		    
                			let img = document.createElement("img");
                			img.src = "modules/" + self.name + "/" + this.config.posterDir + "/" + self.Hash[video.substring(0, video.indexOf('.'))];
                			img.width = width;
                			img.height = height;
                		    button.appendChild(img);
                		return button;
                	},
                	swapVideo: function () {
                		Log.log("in handler for button="+this.getAttribute("data-video-src"));
                		self.player.src = this.getAttribute("data-video-src");
                		self.player.load();
                		self.player.controls = true;
                		self.player.play();
                	},
                

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Sam, technical setup by Karsten.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy