keydown event

Discussion in 'ASP .Net' started by Claudia Fong, Sep 17, 2007.

  1. Claudia Fong

    Claudia Fong Guest

    Hi, in my C# application I have the following keydown event

    private void Form1_KeyDown(object sender, KeyEventArgs e)
    {
    if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.A)
    MessageBox.Show("Combination of ALt and A pressed");
    else if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.F1)
    MessageBox.Show("Combination of ALt and F1 pressed");
    }

    I was wondering if I can do the same with asp.net?


    Cheers!

    Claudi

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Claudia Fong, Sep 17, 2007
    #1
    1. Advertising

  2. Yes, but in Javascript instead of C#.

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Claudia Fong" <> wrote in message
    news:O9AVoeT%...
    > Hi, in my C# application I have the following keydown event
    >
    > private void Form1_KeyDown(object sender, KeyEventArgs e)
    > {
    > if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.A)
    > MessageBox.Show("Combination of ALt and A pressed");
    > else if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.F1)
    > MessageBox.Show("Combination of ALt and F1 pressed");
    > }
    >
    > I was wondering if I can do the same with asp.net?
    >
    >
    > Cheers!
    >
    > Claudi
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
     
    Eliyahu Goldin, Sep 17, 2007
    #2
    1. Advertising

  3. "Claudia Fong" <> wrote in message
    news:O9AVoeT%...

    > I was wondering if I can do the same with asp.net?


    Yep - in JavaScript, obviously...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], Sep 17, 2007
    #3
  4. Claudia Fong

    Claudia Fong Guest

    WELL..is there other option?
    Because pocket internet explorer does not support javascript.. at least
    the code that I'm writing.. because I already tried

    Cheers!

    Claudi

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Claudia Fong, Sep 18, 2007
    #4
  5. Mark Rae [MVP], Sep 18, 2007
    #5
  6. Claudia Fong

    Claudia Fong Guest

    When I said that it does not support is because I can't download
    anything to the PDA.. I can only use the original PIE.. and with this
    one, the javascript I wrote doesn't work..

    document.onkeydown = keydown;
    function keydown(evt)
    {
    if (!evt)
    evt = event;


    //if (evt.shiftKey && evt.keyCode == 9)
    // if (evt.shiftKey && evt.keyCode == 32)
    if (evt.ctrlKey && evt.keyCode == 65)
    {
    myfunction()

    }
    }

    function myfunction()
    {
    window.open("Language.aspx", '_blank');
    window.opener='x';window.close();
    }


    Cheers!

    Claudi

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Claudia Fong, Sep 18, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mee-shell

    Keydown Event and Focus Problem

    mee-shell, Oct 23, 2004, in forum: Python
    Replies:
    0
    Views:
    596
    mee-shell
    Oct 23, 2004
  2. Replies:
    1
    Views:
    686
    cfps.Christian
    May 23, 2008
  3. jaspal singh

    trap keypress and keydown event in asp.net mobile form

    jaspal singh, Nov 24, 2006, in forum: ASP .Net Mobile
    Replies:
    1
    Views:
    1,485
  4. Atul Thombre

    KeyDown event on Smartphones

    Atul Thombre, Sep 11, 2008, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    861
    Atul Thombre
    Sep 11, 2008
  5. runner7

    programmatic firing of keydown event

    runner7, Sep 8, 2006, in forum: Javascript
    Replies:
    9
    Views:
    350
    runner7
    Sep 11, 2006
Loading...

Share This Page