Author Topic: MOUSEMOVEMENT: Bugged or depreciated?  (Read 4712 times)

0 Members and 1 Guest are viewing this topic.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
MOUSEMOVEMENT: Bugged or depreciated?
« on: August 04, 2019, 06:51:34 am »
The fact that nobody caught this yet makes me think I'm the only one using _MOUSEMOVEMENT... Or maybe its my hardware?

Code: QB64: [Select]
  1.         PRINT "X"; _MOUSEMOVEMENTX
  2.         PRINT "Y"; _MOUSEMOVEMENTY
  3.     LOOP

... does nothing with X-movements, and only gives (positive) 1 for Y-movements. This worked before 1.3.
« Last Edit: August 04, 2019, 06:53:31 am by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: MOUSEMOVEMENT: Bugged or depreciated?
« Reply #1 on: August 04, 2019, 07:31:41 am »
Hi! You don't even know how nice to see you here, librarian! I've got a job for you! You like that, don't you?

First. To your query. This problem is known and FellippeHeitor is upset about me because I have no patience. I didn't mean it, but I insulted him. I did not want that. That is, just the day that the new QB 1.3 was released and the QB64.ORG homepage was updated, I just pointed out this error. Fellippe say work is underway in this.

Second. As a library manager, I ask you to update the tool thread. I'm sure there definitely, there be add the Steve Library DIRENTRY.H + sample program, Dithering, which is somewhere in the forum, and other things that have shown up. There is only one thing so far and that is really not enough. Thank you for understanding.

« Last Edit: August 04, 2019, 07:43:27 am by Petr »

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: MOUSEMOVEMENT: Bugged or depreciated?
« Reply #2 on: August 04, 2019, 07:52:20 am »
As a library manager, I ask you to update the tool thread.  There is only one thing so far and that is really not enough.

Hmm.  Methinks that Petr wants you to be DYNxAxMIC rather than STxAxTIC!

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: MOUSEMOVEMENT: Bugged or depreciated?
« Reply #3 on: August 04, 2019, 07:56:47 am »
Hmm, Qwerkey, maybe...? :) 

Let's make it easier for a librarian, write your tips on what to add to the tool library! I suggest, as I wrote, Steve the Direntry.H library for browsing files and folders under Linux and under Windows. Then Ashish program for capturing the OpenGL surface onto a software screen, Dithering (converting an image from 32 bits to 256/16/4/2 colors) and maybe even my program for loading icons from ICO files. I'll add links here.

For OpenGL layer to Software layer program (just add _GLRENDER _BEHIND to row 13), author Ashish:  https://www.qb64.org/forum/index.php?topic=1492.msg106974#msg106974
For Browsing Directories/Files under Linux and Windows + DiskDrives under Windows, author SMcNeill:  https://www.qb64.org/forum/index.php?topic=321.msg2137#msg2137
For using ICO (all ICO images from ICO file), if you insert -1 as image number, then program show all icons in file for you, author Petr: https://www.qb64.org/forum/index.php?topic=688.msg5661#msg5661
For using Dithering use this source code. Athor for both function is Ashish Kushwaha:

Code: QB64: [Select]
  1. SCREEN grayscale&(s)
  2. _FREEIMAGE grayscale&(s)
  3. SCREEN FloydSteinbergDithering&(s, 1)
  4.  
  5.  
  6. FUNCTION grayscale& (img&) '                         This is not my source, its coded By Ashish
  7.     grayscale& = _COPYIMAGE(img&)
  8.     preDest = _DEST
  9.     preSource = _SOURCE
  10.  
  11.     _DEST grayscale&
  12.     _SOURCE grayscale&
  13.     FOR yy = 0 TO _HEIGHT - 1
  14.         FOR xx = 0 TO _WIDTH - 1
  15.             col~& = POINT(xx, yy)
  16.             b = max(max(_RED(col~&), _GREEN(col~&)), _BLUE(col~&))
  17.             PSET (xx, yy), _RGB(b, b, b)
  18.     NEXT xx, yy
  19.     _DEST preDest
  20.     _SOURCE preSource
  21.  
  22.  
  23.  
  24. FUNCTION FloydSteinbergDithering& (img&, factor AS INTEGER) 'This is not my source, its coded By Ashish
  25.  
  26.     preDest = _DEST
  27.     preSource = _SOURCE
  28.  
  29.     FloydSteinbergDithering& = _COPYIMAGE(img&)
  30.     _DEST FloydSteinbergDithering&
  31.     _SOURCE img&
  32.     FOR y = 0 TO _HEIGHT(img&) - 1
  33.         FOR x = 0 TO _WIDTH(img&) - 1
  34.             col~& = POINT(x, y)
  35.             oldR = _RED(col~&)
  36.             oldG = _GREEN(col~&)
  37.             oldB = _BLUE(col~&)
  38.  
  39.             newR = _ROUND(factor * (oldR / 255)) * (255 / factor)
  40.             newG = _ROUND(factor * (oldG / 255)) * (255 / factor)
  41.             newB = _ROUND(factor * (oldB / 255)) * (255 / factor)
  42.  
  43.             errR = oldR - newR
  44.             errG = oldG - newG
  45.             errB = oldB - newB
  46.  
  47.             col2~& = POINT(x + 1, y)
  48.             r = _RED(col2~&) + errR * 7 / 16
  49.             g = _GREEN(col2~&) + errG * 7 / 16
  50.             b = _BLUE(col2~&) + errB * 7 / 16
  51.             PSET (x + 1, y), _RGB(r, g, b)
  52.  
  53.             col2~& = POINT(x - 1, y + 1)
  54.             r = _RED(col2~&) + errR * 3 / 16
  55.             g = _GREEN(col2~&) + errG * 3 / 16
  56.             b = _BLUE(col2~&) + errB * 3 / 16
  57.             PSET (x - 1, y + 1), _RGB(r, g, b)
  58.  
  59.             col2~& = POINT(x, y + 1)
  60.             r = _RED(col2~&) + errR * 5 / 16
  61.             g = _GREEN(col2~&) + errG * 5 / 16
  62.             b = _BLUE(col2~&) + errB * 5 / 16
  63.             PSET (x, y + 1), _RGB(r, g, b)
  64.  
  65.             col2~& = POINT(x + 1, y + 1)
  66.             r = _RED(col2~&) + errR * 1 / 16
  67.             g = _GREEN(col2~&) + errG * 1 / 16
  68.             b = _BLUE(col2~&) + errB * 1 / 16
  69.             PSET (x + 1, y + 1), _RGB(r, g, b)
  70.  
  71.  
  72.  
  73.             PSET (x, y), _RGB(newR, newG, newB)
  74.     NEXT x, y
  75.  
  76.     _DEST preDest
  77.     _SOURCE preSource
  78.  
  79. FUNCTION max! (a!, b!)
  80.     IF a! > b! THEN max! = a! ELSE max! = b!
  81.  

and then, Librarian, please see to new BPlus thread: https://www.qb64.org/forum/index.php?topic=1511.0


Thank you.
« Last Edit: August 04, 2019, 08:50:26 am by Petr »

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: MOUSEMOVEMENT: Bugged or depreciated?
« Reply #4 on: August 04, 2019, 08:03:50 am »
Hello, long time no see.

You guys raise valid points about library/toolbox stuff. I'll start getting on it in some fashion. Remind me in 6 months if I forget. :-)

As for the mouse bug... welp... it needs attention.
You're not done when it works, you're done when it's right.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: MOUSEMOVEMENT: Bugged or depreciated?
« Reply #5 on: August 04, 2019, 08:21:33 am »
This issue is old, older than v1.3

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: MOUSEMOVEMENT: Bugged or depreciated?
« Reply #6 on: August 06, 2019, 07:57:58 pm »
Confused-shit say: It is easier for a chronic opioid user to have a _BOWELMOVEMENT than for a cute 64'er to make use of  _MOUSEMOVEMENTX.

I just use _MOUSEX and _MOUSEY and make my own functions to detect if the mouse cursor was moved.

This did function, as advertised in the two Wiki examples, in version 1.1, but failed in both version 1.2 and 1.3.

Hi Bill, nice to see finally remembered your QB64 Forum password: petecanbitemy....

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/