Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Keyboard behavior (Read 2854 times)
JR
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 86
Joined: Jun 12th, 2007
Keyboard behavior
Feb 28th, 2012 at 10:27am
Print Post  
Hello,

I have a question about keyboard events and keyboard behavior.

I have a diagram.
I can move in the document with the arrows keys, scrollbars and mouse wheel.

I have put the following code
Code
Select All
Ocx_Flowchart.KbdActive (true)
Ocx_Flowchart.KbdBehavior (0)	//kbScrollView
 



I don't want that the DEL key deletes an item.
How can I forbid this ? I don't need also cut/copy/paste actions.

Regards
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Keyboard behavior
Reply #1 - Feb 28th, 2012 at 11:54am
Print Post  
You will have to disable KbdActive and scroll the diagram yourself in response to the KeyDown event:

Code
Select All
Private Sub fcx_KeyDown(ByVal KeyCode As Long, ByVal Shift As Long)
    Dim vkLeft, vkUp, vkRight, vkDown As Integer
    vkLeft = &H25
    vkUp = &H26
    vkRight = &H27
    vkDown = &H28

    If KeyCode = vkLeft Then fcx.ScrollX = fcx.ScrollX - fcx.ScrollRate
    If KeyCode = vkRight Then fcx.ScrollX = fcx.ScrollX + fcx.ScrollRate
    If KeyCode = vkUp Then fcx.ScrollY = fcx.ScrollY - fcx.ScrollRate
    If KeyCode = vkDown Then fcx.ScrollY = fcx.ScrollY + fcx.ScrollRate
End Sub 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
JR
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 86
Joined: Jun 12th, 2007
Re: Keyboard behavior
Reply #2 - Feb 28th, 2012 at 1:14pm
Print Post  
Thank you.

It works
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint