how to Send the CTRL+SHIFT keys (no other key) 
Author Message
 how to Send the CTRL+SHIFT keys (no other key)

I search a way to send a CTRL+SHIFT in Windows 95 with VB3.

thanks

Alain




Sat, 06 Jun 1998 03:00:00 GMT  
 how to Send the CTRL+SHIFT keys (no other key)

Quote:

>I search a way to send a CTRL+SHIFT in Windows 95 with VB3.

Hmmm.  You haven't sent an ASCII character yet.
The CTRL and SHIFT keys are toggles.  They set bits
in low memory addresses under the old Windows/DOS stuff.
You could *read* those with a DLL, but I don't know if
you could set those.  I seem to recall these were called
keyboard scan codes - different from ASCII characters.

Sorry I can't be of more help.
--

Systems Analyst         WWW:    http://www.phoenix.net/~getj



Mon, 08 Jun 1998 03:00:00 GMT  
 how to Send the CTRL+SHIFT keys (no other key)


Quote:

>>I search a way to send a CTRL+SHIFT in Windows 95 with VB3.

I believe that this will do what you want.

Save the sample below as Form1.frm, then load it in VB and RUN it.

====== Save as Form1.frm ===========
VERSION 2.00
Begin Form Form1
   BackColor       =   &H00C0C0C0&
   Caption         =   "Form1"
   ClientHeight    =   2148
   ClientLeft      =   3996
   ClientTop       =   3120
   ClientWidth     =   3336
   Height          =   2532
   Left            =   3948
   LinkTopic       =   "Form1"
   ScaleHeight     =   2148
   ScaleWidth      =   3336
   Top             =   2784
   Width           =   3432
   Begin TextBox Text1
      Height          =   288
      Left            =   1584
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   336
      Width           =   972
   End
   Begin Label Label6
      BorderStyle     =   1  'Fixed Single
      Height          =   288
      Left            =   1584
      TabIndex        =   6
      Top             =   1584
      Width          h VB3.

I believe that this will do what you want.

Save the sample below as Form1.frm, then load it in VB and RUN it.

====== Save as Form1.frm ===========
VERSION 2.00
Begin Form Form1
   BackColor       =   &H00C0C0C0&
   Caption         =   "Form1"
   ClientHeight    =   2148
   ClientLeft      =   3996
   ClientTop       =   3120
   ClientWidth     =   3336
   Height          =   2532
   Left            =   3948
   LinkTopic       =   "Form1"
   ScaleHeight     =   2148
   ScaleWi



Mon, 08 Jun 1998 03:00:00 GMT  
 how to Send the CTRL+SHIFT keys (no other key)


Quote:


>>>I search a way to send a CTRL+SHIFT in Windows 95 with VB3.

SORRY, I don't know what happened the last time.

I believe that this will do what you want.

Save the sample below as Form1.frm, then load it in VB and RUN it.

====== Save as Form1.frm ===========
VERSION 2.00
Begin Form Form1
   BackColor       =   &H00C0C0C0&
   Caption         =   "Form1"
   ClientHeight    =   2148
   ClientLeft      =   3996
   ClientTop       =   3120
   ClientWidth     =   3336
   Height          =   2532
   Left            =   3948
   LinkTopic       =   "Form1"
   ScaleHeight     =   2148
   ScaleWidth      =   3336
   Top             =   2784
   Width           =   3432
   Begin TextBox Text1
      Height          =   288
      Left            =   1584
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   336
      Width           =   972
   End
   Begin Label Label6
      BorderStyle     =   1  'Fixed Single
      Height          =   288
      Left            =   1584
      TabIndex        =   6
      Top             =   1584
      Width           =   972
   End
   Begin Label Label5
      BackStyle       =   0  'Transparent
      Caption         =   "KeyCode%"
      Height          =   288
      Left            =   480
      TabIndex        =   5
      Top             =   1584
      Width           =   972
   End
   Begin Label Label4
      BorderStyle     =   1  'Fixed Single
      Height          =   288
      Left            =   1584
      TabIndex        =   4
      Top             =   1152
      Width           =   972
   End
   Begin Label Label3
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Shift%"
      Height          =   288
      Left            =   480
      TabIndex        =   3
      Top             =   1152
      Width           =   972
   End
   Begin Label Label2
      BorderStyle     =   1  'Fixed Single
      Height          =   288
      Left            =   1584
      TabIndex        =   2
      Top             =   720
      Width           =   1308
   End
   Begin Label Label1
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Keys Pressed"
      Height          =   288
      Left            =   144
      TabIndex        =   1
      Top             =   720
      Width           =   1296
   End
End

Sub Text1_KeyDown (KeyCode As Integer, Shift As Integer)
  Select Case Shift%
    Case 1: Shft$ = "Shift": Label2.Caption = "Shift"
    Case 3: Shft$ = "Alt": Label2.Caption = "Shift/CTRL"
    Case 5: Shft$ = "Ctrl": Label2.Caption = "Shift/ALT"
    Case Else: Label2.Caption = ""
  End Select

  Label4.Caption = Shift%
  Label6.Caption = KeyCode%

End Sub



Mon, 08 Jun 1998 03:00:00 GMT  
 how to Send the CTRL+SHIFT keys (no other key)
Read help for KeyDown - The shift part would be 1 + 2 = 3 for Ctrl+Shift.
CM


Fri, 12 Jun 1998 03:00:00 GMT  
 how to Send the CTRL+SHIFT keys (no other key)

Quote:

> Read help for KeyDown - The shift part would be 1 + 2 = 3 for Ctrl+Shift.
> CM

I am having a similar problem but with the TAB key.  I can trap out the
other navigational codes (up arrow,down arrow,etc), but the TAB is trapped
by the form and will not let the control get it.  I tried changing the KeyPreview
property of the Form but it has seemly no effect.  BTW this is VB3.0 Pro.

Any clues???

D.M. (Mike) Mattix
Crop Protection Group of Monsanto
Luling, LA



Sun, 14 Jun 1998 03:00:00 GMT  
 how to Send the CTRL+SHIFT keys (no other key)

Quote:


>> Read help for KeyDown - The shift part would be 1 + 2 = 3 for Ctrl+Shift.
>> CM
>I am having a similar problem but with the TAB key.  I can trap out the
>other navigational codes (up arrow,down arrow,etc), but the TAB is trapped
>by the form and will not let the control get it.  I tried changing the KeyPreview
>property of the Form but it has seemly no effect.  BTW this is VB3.0 Pro.
>Any clues???

As for the TAB character, you may want to try putting code in the
form's Key* events as a first pass.

If that doesn't work, a method offered on making virtual controls may
be applicable.  The method suggests you set the tab stop property of
all controls on a form to false and then trap the tab character
yourself and set the focus to the next control in the tab order.
Apparently when no controls have a tab stop set, the tab character is
passed to the controls.  

For what its worth, HTH

Doug Renz




Sun, 14 Jun 1998 03:00:00 GMT  
 how to Send the CTRL+SHIFT keys (no other key)

Quote:


>Subject: Re: how to Send the CTRL+SHIFT keys (no other key)
>Date: Wed, 27 Dec 1995 22:04:05 GMT



>>> Read help for KeyDown - The shift part would be 1 + 2 = 3 for Ctrl+Shift.
>>> CM
>>I am having a similar problem but with the TAB key.  I can trap out the
>>other navigational codes (up arrow,down arrow,etc), but the TAB is trapped
>>by the form and will not let the control get it.  I tried changing the KeyPreview
>>property of the Form but it has seemly no effect.  BTW this is VB3.0 Pro.
>>Any clues???
>As for the TAB character, you may want to try putting code in the
>form's Key* events as a first pass.

This isn't THAT easy. You must have tab stop set to false on all controls.
Then the TAB key will pass to the key press event. The KB has a article on
this. It shows you how to turn the tab stop on & off at appropriate times in
code.
JK


Wed, 17 Jun 1998 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. how to send (Right CTRL+Shift) keys

2. Block System Key like ALT+TAB, Ctrl+Alt+Del, Ctrl+Esc key

3. Shift, ctrl and Alt keys in QuickBasic

4. Ctrl or Shift Key Down

5. Detecting key status for shift, ctrl and alt

6. Testing for Shift or Ctrl key presses during Drag and Drop

7. shift and ctrl keys

8. Cancelling Shift, Ctrl, and Alt keys

9. Help ~~ How to trap function keys ?(Alt ,Ctrl ,Shift)

10. Bypass Key (Shift Key)

11. Changing the AllowbyPass key from shift to some other Key

12. Capturing Tab key and Shift-Tab key

 

 
Powered by phpBB® Forum Software