 So Ember's birthday was the other day and she got her USB microscope and she learned an important lesson Whenever you get a new piece of hardware for your computer and you open the box and it comes with a CD that has software on there What's the first thing you do? Yeah, throw that software in the garbage because it's crack Anyway, she has been playing with her microscope and she has been loving it and I just wanted to I know I already did a video on it, but I want to do a follow-up video because there were a few things that I quickly mentioned But I want to go over a little more in detail So let's go ahead and jump in and have a look at this So we're real quick to review you can use any webcam software you can use cheese or was it GUCV viewer or something along those lines or I prefer MPV for almost all my media stuff And for that you have to type MPV AV for audio video using video for Linux 2 That's for that's drivers for video inputs on Linux And then you have your device which in my case is video zero because it's the only webcam I have if you have more than one webcam the number might change at the end depending on which number the webcam is I'll go ahead and hit enter and there we go. Don't worry. We won't be looking at my nose again today But here this is my jeans my blue jeans that I'm wearing these are the threads so That's simple enough, but that's kind of a lot to remember of course. It's in your history So it's easy to search through your your bash or whatever shell you use history But of course it'd be easier if you alias it so for example, I could be like alias I call it scope equals and then I can say this We'll just take that command and paste it in there And then at any point after that I can type in scope and it runs that command for me and again Here's my denim jeans. Here is the fabric on my t-shirt great And all you have to do is take this line right here alias scope or whatever you want to call it and put it in Your RC file for bash or be dot bash RC for Z shell It's Z dot Z shell RC or both of them you could use dot Bash or Z shell RC dot local depending on how your your system set up and then anytime you start your shell Now then all you have to do is type scope. I took it a step further for ember though because let's go ahead and run scope again is At any point so like I'm here looking at my denim if I hit s it takes a screenshot and saves it to your current directory Well, we want all her photos taken in one spot. So let me go here. So now This screen here is on embers computer So now I actually wrote her a little script. I'm a user local bin and I called it scope I have a pseudo into it and oh my password does not work. I have to type in her password There we go. So what I actually do here is I set a directory in the home directory called scope So we're saying that as a variable and then I am every time the script runs it if that's I'm not checking if that Directory exists, but I'm trying to create it. It'd be better if I checked if you want to be technical about it But it tries to create that directory and then moves into it and then it starts our MPV command And I also added this dash dash FS so it starts full screen for her And then when it's done when she quits out of MPV by hitting Q She then starts up Thunar, which is her file browser. Really I could replace this with Xdg dash open which would open up and then I think we could do dot or whatever director I actually probably best if I said Durr and that would open it up with ever her default File browsers that'd be a better way to do it, but this is not gonna go anywhere other than her computer So what happens then is since it's creating that directory moving into it every time she takes screenshot by hitting s on the Keyboard it saves that and then it opens up that file browser to view those when she's done So that's what I wrote up for her So real quick, let's look at some Still shots that ember and I took of an ant so the like I said the Camera the microscope came a little cap So you can put things in there and she caught an ant and she put it in there It took us a while for the ant to stop moving and get it in the right spot But we got some good shots and we did let the ant go afterwards and he ran off For those of you who are concerned about the ant. Let's go ahead and look at some of those still shots One of my concerns That I was hoping to achieve is on the microscope here Everything works out of box except for there's two red buttons one on each side one says zoom and one says snap I assume the zoom was for a digital zoom because you zoom with the with the big knob here So I assume and the software came with the zoom button would zoom and the snap would take a snapshot now We just went over with MPV how to take a snapshot like I said with cheese and most other webcam applications There might be a button with MPV you press S So I was hoping to be able to map these buttons to be able to do that So let's go ahead and have a look on how you might go about doing that If you go under your dev folder and then input so dev is where all your devices are so All the hardware on your computer is listed here as files input would be input So I was hoping that not only would this Microscope show up as a webcam a video input But it would show up as a hidden device a master keyboard device For example, you you might have multiple hidden devices keyboard like devices that aren't necessarily keyboards for example I have a USB headset here that have controls for volume play and pause and they show up as A hidden device as a keyboard and they send the same keys as the media keys on my keyboard with but they show up as a Completely different keyboard so under inputs if I list here You can see that we have a bunch of events which most of these are going to be some sort of key keyboard input And then we have some mouse events So for example, if I was to pseudo cat and to cat out the wrong formation from this you need either you need to have Permissions and so I'm just gonna pseudo cat and mouse one should be my main mouse here So I did that and you don't see anything But if I start moving my mouse left and right you can see or up and down it starts printing out raw data and There's not much we can do with this here I actually have plans on doing a whole a couple of videos a series on Input devices enabling them disabling them remapping them using both Python and bash scripts But here's just a quick overview So that's that was that but how do you know which devices which because it's like I can assume that if I just plugged in The camera, it's gonna be the last one probably this one here But how do I know for sure? Well, you notice there's two folders in here by path and by ID Let's go ahead and go inside the by ID folder and we list things out now We get the devices based on their name. You can see I have some Logitech keyboards and mouse events and then My microphone My headset and then this one right here again I only have one camera hooked up to my computer so we can know this is it So what I can do now is theoretically so just like before I should be able to Cat out pseudo cat this and that would be yeah my mouse. So I move my mouse. I get that if I list out now and I cat out again pseudo cat This device and And I hit enter you would think that I would be able to press those buttons and get information Unfortunately, I'm not So now it's gone beyond my skills if it's not getting the raw data when those buttons are pressed And I have the correct device selected and that is that is the correct device because watch if I unplug the camera now It lost connection and if I list things out that device is no longer there If I plug it back in and list the devices out you can see it shows up again So that's the correct device for the camera But it's not seeing the button presses unfortunately. It's not the end of the world again My daughter just you know holds the camera with one hand and presses s on the keyboard to take a screenshot It would be nice to be able to click that little red button, but What can you do? So so far that's the only thing but in many many cases You would be able to access the device that way another way you can test things out is XEV and that opens this up. So now like if I move my mouse over here, you can see in the shell I'm getting output if I click it tells me what button. I'm clicking and Now that I'm in that window I should theoretically if this was showing up as a keyboard or mouse I should be able to click these buttons and something would show up and it doesn't if I take my USB headset and I click the Volume up button you can see that it detects it over there And it gives you information on on what that button is it's being pressed and at that point you can use that to remap it to a script or Or what not some sort of command, but right now the camera isn't showing anything So although it's detecting it as an input device It's just not set up through my Linux kernel through the modules to recognize those key presses unfortunately again very minor Again s will take a screenshot on the keyboard So but s is taking a screenshot now the other side I said a zoom we already zoom in and out Let me go ahead and type scope Full screen there You zoom in and out by turning the big silver knob on The the camera itself so like so and I can zoom out by turning that I assume the zoom I would zoom I would assume the zoom button was for a digital zoom which you can still do An MPV to zoom out its alt minus to zoom in its alt plus So really most keyboards would be all shift plus and again This is a digital zoom so more you zoom in just the more pixelated it's going to be but for some reason You wanted to you can hit alt shift the plus sign or all plus sign if you Depending on your keyboards map, but normally the plus key is the equals key So to get the plus you have to do shift so it's all shift plus which is a little awkward And I don't know if my daughter would be able to do that with her little hands But I don't I'm not a big fan of digital zoom in general anyway Just take the screenshot and zoom in after Because digital zoom is just losing quality But if you want to you do that and if we were able to get a signal from these buttons on the camera We would have been able to remap them to that but That's not happening Try I think if there anything else I want to go over that's pretty much it Again, just a little follow-up to a previous video talking about some things I mentioned that I want to go more into detail about so Thank you for watching and as always please visit my website films by Chris calm That's Chris the K there's a link in the description and as always I hope that you have a great