Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 8th, 2008, 9:03 PM   #1
ashura517
Newbie
 
Join Date: Jun 2008
Posts: 3
Rep Power: 0 ashura517 is on a distinguished road
Exclamation How do i stimulate keyboard events?

Hi

I am using VB 2005 Express Edition. I have to create a form by using graphics objects. For example i want to draw something using pen object, how do i draw by using keyboard keys w/o using the mouse?
ashura517 is offline   Reply With Quote
Old Jun 9th, 2008, 1:28 AM   #2
~The~ICE~Man~
Programmer
 
Join Date: Feb 2008
Location: Canada
Posts: 13
Rep Power: 0 ~The~ICE~Man~ is on a distinguished road
Send a message via MSN to ~The~ICE~Man~ Send a message via Yahoo to ~The~ICE~Man~
Re: How do i stimulate keyboard events?

I at first thought you where trying to make somekind of keylogger by the question LOL ,,,,, most common is to use the Directional arrow keys or to designate specific keys to do use ( some call them Hot Keys ) Like hold Ctrl + A to do one thing and so on with other keys hope that helps you a bit
~The~ICE~Man~ is offline   Reply With Quote
Old Jun 9th, 2008, 8:37 PM   #3
ashura517
Newbie
 
Join Date: Jun 2008
Posts: 3
Rep Power: 0 ashura517 is on a distinguished road
Exclamation Re: How do i stimulate keyboard events?

Quote:
Originally Posted by ~The~ICE~Man~ View Post
I at first thought you where trying to make somekind of keylogger by the question LOL ,,,,, most common is to use the Directional arrow keys or to designate specific keys to do use ( some call them Hot Keys ) Like hold Ctrl + A to do one thing and so on with other keys hope that helps you a bit
Hey thanks for replying.
Before i designate the keys, I must set the the cursor's position first. For example, i created a cursor for the Current cursor's Hanlde, changes its position and clipping rectangle. I tried out the code, but there are several errors and warnings. Any help?

Public Class Form1
    Dim value As Point
    value = Cursor.Position
    Cursor.Position = value

    Private Sub MoveCursor()
        ' If the form's cursor is not the Default cursor,
        ' set the Current cursor, move the cursor's Position,
        ' and set its clipping rectangle to the form. 
        If Not Me.Cursor.Equals(Cursors.Default) Then
            Me.Cursor = New Cursor(Cursor.Current.Handle)
            Cursor.Position = New Point(Cursor.Position.X - 50, Cursor.Position.Y - 50)
            Cursor.Clip = New Rectangle(Me.Location, Me.Size)
        End If
    End Sub
End Class

ashura517 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenCV Help Needed: Can't use the keyboard while running cvcamSetPropetry Phanixis C++ 3 May 15th, 2007 3:04 PM
How to handle keyboard events in an app containing ActiveX Controls ? George Giolfan Visual Basic .NET 0 Aug 7th, 2005 3:07 AM
keyboard: switching scripts EverLearning Coder's Corner Lounge 5 Jul 22nd, 2005 8:04 PM
Interfacing with a Keyboard brkstf Assembly 7 Mar 21st, 2005 3:48 PM
How do I direct stdout to the screen, stdin to the keyboard? fzrrider C++ 0 Feb 13th, 2005 5:33 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:06 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC