Mouse buffer
Dave Higton (1515) 3526 posts |
Is it possible to use the Buffer Manager to insert blocks of bytes into the mouse buffer? I can’t find the mouse buffer’s handle, so I can’t get the internal buffer info and therefore I can’t call the buffer manager’s services. |
Steve Pampling (1551) 8170 posts |
Inserting to simulate mouse button clicks, or to move the cursor left/right, up/down with keypresses? Both are possible, there are 26 bit utilities to that, some even converted to 32. |
Dave Higton (1515) 3526 posts |
The question really is about whether it’s possible to use Buffer Manager to do the job, thanks, Steve. |
Jean-Michel BRUCK (3009) 359 posts |
I just finished putting the module in C, indeed it is not easy to find all the information. but it works.
The use of the buffer manager is not necessary, because only one block is written. KeyPress works with OsCallAVector. If you wish I can send you a copy of my version so you can give your opinion. |
Dave Higton (1515) 3526 posts |
It’s all a bit vexing. If the object is to set the mouse position and simulate button presses and releases, the most obvious way to me is to use the Buffer Manager to insert an appropriate block of data into the mouse buffer. However, it isn’t possible because the Buffer Manager needs to be passed the internal buffer ID, which can be got from the Buffer_InternalInfo call, but that needs to be passed the buffer handle, which we don’t know (and it’s not the buffer number). Calling InsV seems like a sledge hammer, but it’s part of what the original MouseCmd module uses, so I tried that. I couldn’t get it to work, no matter what I did. No error, but no mouse movement either. I only tried block mode. OS_Byte 138 called 9 times didn’t work either. The original module calls OS_Word 21, 3 before calling InsV. I cannot see why it should do both. OS_Word 21, 3 works for me – to set the mouse position, anyway. |
Steve Pampling (1551) 8170 posts |
As I recall, it’s a few years gap1, the code reads the mouse position info, puts that into the buffer block, amends the info in response to user actions and then writes from that block into the actual mouse buffer. Stuff from when I was messing around with adding key-mouse functionality to the Wimp here 1 Almost exactly 4 years, it seems. |
Jean-Michel BRUCK (3009) 359 posts |
I asked myself the question. I think that mouse manipulation should be done in two stages: InsV exists as a function in OSlib and it is part of buffer.h so used by Buffer Manager. The third step is to simulate pressing (or releasing) a mouse button Here too you have to insert into a vector of values in the key vector, The asm module uses OS_CallAvector, I did the same thing. |