Reset keyboard keys

I have a project I am working on and it requires that the keys on the keyboard read different than what is on them. For instance, I would like the letter "I", when press, to return the numeric value of "4".

Can anyone help




Answer this question

Reset keyboard keys

  • ron nash

    What change would I make to the code if I wanted the letter 'J', when pressed, to equal 4

  • Deedhun

    One last question: I am reseting the number '9' key (across the top of the keyboard) to '0'. At the same time, I am reseting the period key to the number '9'. When I pressed the period key, the number '0' appears. Can you tell me how to keep this key, the 'period' key, from showing the number '0' and show the number '9'

  • DQM

    I put an answer in your earlier post with the same question.

    Hope it helps.

    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1017304&SiteID=1



  • dampbarn

    Replace the test on Keys.A with Keys.J. And SendKeys("4"), no need to test for the Shift state.


  • JohnGBunch

    One last question: I am reseting the number '9' key (across the top of the keyboard) to '0'. At the same time, I am reseting the period key to the number '9'. When I pressed the period key, the number '0' appears. Can you tell me how to keep this key, the 'period' key, from showing the number '0' and show the number '9'

  • nishanttheone

    I can't quote the code just yet, but you might want to look into a free app named SharpKeys that does the very same thing and for info on just what it does and the registry values you'd need to tweak to do it yourself, take a look at these (1, 2).

  • JDCAMP

    Figured it out. Thanks a bunch.

  • isunshine

    Disregard previous reply. Is the assignment different for number keys I would like for the number '9', when pressed, to return the number '0'.

  • albewar

    The author of SharpKeys carefully avoids telling what the "magic registry key" really is. Ten to one, he's hacking the Scancode Map key of HKLM\System\CCS\Control\Keyboard Layout. That's going to take a reboot to take effect and is going to remap the key for every program on your PC afterwards.

    You can keep the remapping confined to your form by setting its KeyPreview property to True and replacing the key in the KeyDown event handler. For example, this code replaces an "A" with a "B":

    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    If e.KeyCode = Keys.A Then
    e.SuppressKeyPress = True
    If e.Shift Then SendKeys.Send("B") Else SendKeys.Send("b")
    End If
    End Sub



  • Reset keyboard keys