![]() |
Forum Index : Microcontroller and PC projects : CMM2: V5.07.00b1 - Mouse heaven
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
yock1960 Senior Member ![]() Joined: 18/08/2020 Location: United StatesPosts: 167 |
Peter, Just installed the beta, if I double click on any filename to run, I get an 'IC2C not open error'. Running again works normally. Steve |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10013 |
What options? what type of mouse and how connected? |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Hmmm.... no comment Tom, though I have to say mine are like silken drawers compared to yours. ![]() Greg |
||||
yock1960 Senior Member ![]() Joined: 18/08/2020 Location: United StatesPosts: 167 |
options: VGA mode 800x600 RGB332 display 50,100 USBKeyboard US Hobbytronics wired for channel 2 Steve |
||||
yock1960 Senior Member ![]() Joined: 18/08/2020 Location: United StatesPosts: 167 |
What options? what type of mouse and how connected? options: VGA mode 800x600 RGB332 display 50,100 USBKeyboard US Hobbytronics wired for channel 2 Steve Old wired logitech USB mouse. |
||||
mclout999 Guru ![]() Joined: 05/07/2020 Location: United StatesPosts: 482 |
Just installed the beta, if I double click on any filename to run, I get an 'IC2C not open error'. Running again works normally. Steve I get the same thing sometimes for programs that have previous mouse support HT. I have PS/2 mice several on OPTION MOUSE 0,8. If I OPTION MOUSE OFF it will work again. I have tried to edit some of the program's mouse statements like changing to the right port but that does not work. I think the file manager leave the IC2C open. Also, did you see my comment that if you use CONTROL S to sort the mouse just stops working and the cursor disappears? Thanks. |
||||
Rado Regular Member ![]() Joined: 27/11/2020 Location: CroatiaPosts: 59 |
@thwill - I ran the code directly from the filemanager. I'll upload the new beta firmware and see if it will fix some of the issues I have with the old beta. Anything found will be reported in that beta thread. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6213 |
This is an update to Peters mouse test program. It includes the wheel, double click and a QUIT button. I have added some code at the exit to hopefully turn everything off gracefully. This should prevent the occasional error message on exit. 'mouse and cursor test dim integer quit, mp CLS MODE 1,8 mp = mm.info(option mouse) if mp = -1 then ' no mouse set mp = 0 ' assume PS/2 mouse - change to suit else print "Mouse port ";mp endif GUI CURSOR ON CONTROLLER MOUSE OPEN mp, leftclick, rightclick PRINT "Mouse found is type ",MOUSE(t,0) if MOUSE(t,0) = 3 then PRINT "Mouse has a wheel!" PAUSE 2000 CLS PRINT @(750,10,2)"QUIT" 'I2C2 WRITE 41,1,2,28,10 SETTICK 50, myint DO : LOOP UNTIL quit = 1 SETTICK 0, myint CONTROLLER MOUSE CLOSE mp pause 20 GUI CURSOR OFF END SUB myint GUI CURSOR MOUSE(x,mp),MOUSE(y,mp) PRINT @(10,10)MOUSE(x,mp);" ";MOUSE(y,mp);" s";MOUSE(s,mp);" w";MOUSE(w,mp);" " IF MOUSE(D,mp) THEN PRINT @(10,50)"Doubleclick" ELSE PRINT @(10,50)" " ENDIF END SUB ' SUB leftclick STATIC INTEGER n LOCAL INTEGER x=MOUSE(x,mp),y=MOUSE(y,mp) GUI CURSOR OFF GUI CURSOR ON 1,x,y, RGB(RED) n=n+1 PRINT @(100,100)"left",n if x > 750 and y < 25 then quit = 1 END SUB ' SUB rightclick STATIC INTEGER n=0 LOCAL INTEGER x=MOUSE(x,mp),y=MOUSE(y,mp) GUI CURSOR OFF GUI CURSOR ON 0,x,y n=n+1 PRINT @(200,100)"Right",n END SUB Jim VK7JH MMedit |
||||
mclout999 Guru ![]() Joined: 05/07/2020 Location: United StatesPosts: 482 |
It includes the wheel, double click and a QUIT button. I have added some code at the exit to hopefully turn everything off gracefully. This should prevent the occasional error message on exit. Jim, You should have updated your 3D mouse test program as that thing is beautiful and I have not been able to get it working. I used to just play with it. I will try this one as well. Thank you. I was wondering if the scroll wheel was clickable. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6213 |
Jim, You should have updated your 3D mouse test program as that thing is beautiful and I have not been able to get it working. I used to just play with it. Working on it but this is a busy time in the garden for us southerners. Too busy picking strawberries, raspberries and now the cherry trees are calling... Jim VK7JH MMedit |
||||
mclout999 Guru ![]() Joined: 05/07/2020 Location: United StatesPosts: 482 |
Too busy picking strawberries, raspberries and now the cherry trees are calling... Cool. Sounds like heaven to me. I can still have berries(Type 2 Diabetes) but not the cherries. Enjoy. |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
It includes the wheel, double click and a QUIT button. All working nicely on my 10yo Porto USB mouse Jim, including wheel and wheel click. I'm jealous of your fresh berries and cherries, we had them at our place on the Tamar every year. My mother grew up on a berry farm in Hobart. Greg |
||||
CircuitGizmos![]() Guru ![]() Joined: 08/09/2011 Location: United StatesPosts: 1427 |
Working on it but this is a busy time in the garden for us southerners. Jim It is a toasty 38 degrees here. Unfortunately, that is Fahrenheit. Micromites and Maximites! - Beginning Maximite |
||||
mkopack73 Senior Member ![]() Joined: 03/07/2020 Location: United StatesPosts: 261 |
Anybody test out this firmware with the USB keyboard interface on Piotr's CMM2 Deluxe model? Working ok? (I would assume if the firmware still supports the Hobbytron usb interface then the answer is yes). |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1121 |
I just flashed 7b2. The old Logitech USB mouse I have works fine in PS/2 mode. I notice with TassyJim's test program above that double clicks are registered even if the mouse is moving fast. Ideally a double click should only happen if the mouse has moved less than some threshold between clicks. Note this threshold should not be too close to zero or jittery hands will not be able to double click! Also, the test program works very poorly if you change line 20 to "CLS rgb(white)" The combination of OPTION MOUSE 0 and OPTION COLOURCODE REVERSE does work almost perfectly in the editor. A mouse pointer with a solid center instead of a transparent one might help. I don't see how to specify a user loaded mouse pointer in FILES or EDITOR. Looks like I have a bunch of my programs to add mouse functionality to ... Visit Vegipete's *Mite Library for cool programs. |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1121 |
As others have discovered, stopping a mouse enabled program with Ctrl-C leaves the mouse port in a confused state. A solution to this is to disable Ctrl-C and add a Ctrl-C trap routine to end the program gracefully: ' Put these two lines near the start, Just be careful changing the break character - you can loose the ability to stop a running program, requiring a reset or more to get control back.' just before GUI CURSOR ON and CONTROLLER MOUSE OPEN <chan#> option break 24 ' change ^C to ^Y on key 3, CtrlCQuit ' trap ^C ' Add this routine anywhere convenient sub CtrlCQuit ' trap ^C CONTROLLER MOUSE CLOSE <chan#> pause 20 GUI CURSOR OFF option break 3 ' restore ^C end end sub Also, I see weird mouse cursor glitches if the user loaded sprite is bigger than 16x16 pixels. Could the user loaded mouse pointer be changed to function exactly like the sprite load commands? Or even better, let the mouse cursor BE (any) one of the sprites? Is there a limitation to how many colours a mouse pointer can be? Edited 2021-01-07 11:57 by vegipete Visit Vegipete's *Mite Library for cool programs. |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
In the spirit of my now redundant effort with the PS2 connector made further back in this thread, I have now produced a nice neat USB connector! Check this out. ![]() This is on the standard Silicon Chip CMM2 board. It nicely fits into a slot filed into the standard case. ![]() Holes drilled for the PCB socket in a track-free side area (right hand side, close to the front). Make sure you mark the position on the board carefully before drilling. ![]() Connections made to socket pins. Not much room there but it helps that switched 5v is close-by (main switch) and base plane is ground. I scraped a little resist off to make the ground connection and a solid soldered base for the socket cover pins. 5v and ground connections only end up about 2cms long - the leads for the D+/D- control signals go to the soldered connections of pins 31 and 33 of the 44 pin socket. I used solid insulated hook-up wire which lays pretty flat on the board. ![]() The last one is the mouse lead (optical mouse, 10yr old) modded in-line with 4K7 pullups. I put the pullups in-line so that the control pins (31 and 33) are standard CMM2 when the USB plug is removed. They can then be used for other I/O. I confess I don't consider this last part terribly "neat" - even so it took up about 80% of the total modding time! It would have been easier if I'd had a bare-bones plug but I had to use the original after cutting the lead. Greg |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10013 |
Please find attached V5.07.00b3 http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip This improves the tidy up of programs that exit when using the mouse and/or cursors. In addition it implements a debounce algorithm for PS2 mice button interrupts |
||||
Rado Regular Member ![]() Joined: 27/11/2020 Location: CroatiaPosts: 59 |
Oh, the mighty Guru, Lord Protector of Modern Retronostalgia, this here but a mere worm would like to ask you for a divine favor and a benefit for the whole population who basks in your Glory of Swift Development of New-and-exciting Features: if you could put new beta firmware releases in new threads with a short changelog? - it will be much easier to track the releases than seeking in old threads. ![]() |
||||
RetroJoe![]() Senior Member ![]() Joined: 06/08/2020 Location: CanadaPosts: 290 |
Rado, arguably this is that 5.07 Beta thread, except it got flooded by PS/2 wiring diagrams and mouse test programs :) Thanks, everyone for the liberal sharing of information on the "Lost Art of PS/2 Interfacing", and for Peter coming up with an elegant solution for native mouse support on the CMM2. I've tried every USB mouse in the house with one of the passive "green adapters" I had lying around, but no luck, so I ordered a real PS/2 wired mouse and some green PS/2 jacks, so hope to get this working soon. For future reference, is there a way to determine if a USB mouse supports the PS/2 protocol, besides the "try it and see" method? I'm thinking there has to be some way the mouse determines at power-up if it should run in USB or PS/2 mode, and that this discovery phase is observable e.g. on an oscilloscope. But, I have to think this mode-switching capability was only prevalent for a small number of years, before "legacy-free" motherboards became the norm. Edited 2021-01-13 03:17 by RetroJoe Enjoy Every Sandwich / Joe P. |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |