BBC BASIC for Windows
« Control of Mouse & Keyboard »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:53pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Control of Mouse & Keyboard  (Read 874 times)
Kipper
New Member
Image


member is offline

Avatar




PM


Posts: 8
xx Control of Mouse & Keyboard
« Thread started on: Aug 14th, 2014, 06:49am »

I am working on a project to control Mouse and Keyboard inputs (including Mouse X% & Y%) for people with disability who cannot use their hands. Thus I would like to be able to gain input focus for mouse and keyboard in other programmes, such as MS Word.

What I want to do then is to send a Mouse Click to the buffer so that the PC interprets it as if coming from Mouse when in fact it comes from BBC Basic. I would use the "MOUSE TO" command to locate the pointer position. I want to then also be able to insert text (if needed) at the point of Mouse input focus, again with the PC interpreting input as from the Keyboard rather than from a BBC basic.

I already have some code that controls MOUSE X% and Y% by eye movements but it is the I/O operations that I am struggling with.

Any suggestions welcome!

thanks

Kipper
User IP Logged

rtr
Guest
xx Re: Control of Mouse & Keyboard
« Reply #1 on: Aug 14th, 2014, 09:33am »

on Aug 14th, 2014, 06:49am, Kipper wrote:
What I want to do then is to send a Mouse Click to the buffer so that the PC interprets it as if coming from Mouse when in fact it comes from BBC Basic.

You should be able to adapt the code for faking keyboard input so that it fakes mouse input instead:

http://bb4w.wikispaces.com/Faking+keyboard+input

You will need to change the SYS "keybd_event" call to SYS "mouse_event" and modify the parameters to correspond with what Windows needs as documented here:

http://msdn.microsoft.com/en-gb/library/windows/desktop/ms646260.aspx

Alternatively you can use the SendInput API:

http://msdn.microsoft.com/en-gb/library/windows/desktop/ms646310.aspx

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls