Professional Web Applications Themes

Mac Keycodes - Mac Programming

I looked in the INSIDE MACINTOSH series for the proper keycode for the slash "/". It stated that the the hex code was F2. Is there a different keycode for the slash key in the numeric keypad? The INSIDE MACINTOSH gave them the same keycode, but I have a program I am sending POSTEVENTs to, and yet the program doesn't like the keycode I am sending. The program likes the "/" from the numeric keypad as opposed to the "/" nect to the shif key. Any ideas? Thanks. Patric...

  1. #1

    Default Mac Keycodes

    I looked in the INSIDE MACINTOSH series for the proper keycode for the
    slash "/". It stated that the the hex code was F2. Is there a
    different keycode for the slash key in the numeric keypad? The INSIDE
    MACINTOSH gave them the same keycode, but I have a program I am
    sending POSTEVENTs to, and yet the program doesn't like the keycode I
    am sending. The program likes the "/" from the numeric keypad as
    opposed to the "/" nect to the shif key. Any ideas?

    Thanks.

    Patric
    patric Guest

  2. #2

    Default Re: Mac Keycodes

    "James W. Walker" <osxNOSPAMjwwalker.com.invalid> wrote in message news:<290820031958369229%osxNOSPAMjwwalker.com.in valid>...
    > In article <1ec975dc.0308291209.48a5b2dfposting.google.com >, patric
    > <patrick_cusackhotmail.com> wrote:
    >
    > > I looked in the INSIDE MACINTOSH series for the proper keycode for the
    > > slash "/". It stated that the the hex code was F2. Is there a
    > > different keycode for the slash key in the numeric keypad? The INSIDE
    > > MACINTOSH gave them the same keycode, but I have a program I am
    > > sending POSTEVENTs to, and yet the program doesn't like the keycode I
    > > am sending. The program likes the "/" from the numeric keypad as
    > > opposed to the "/" nect to the shif key. Any ideas?
    >
    > Do you mean key code or character code? The character code for '/' is
    > 2F. The key code on the main keyboard is 2C, and the key code on the
    > numeric keypad is 4B. None of them is F2.
    Yes, I accidentally swapped the 2F. No, my intent is to pass a key to
    a POSTEVENT routine. However, The program that I am sending it to sees
    it as the non-numeric "/", whereas I wish to send the "/" from the
    numeric keyboard. Any suggestions? POSTEVENT requires an eventmsg - I
    assume it means an ascii character? I only wish to somehow
    differentiate between the two slashes.

    Thanks
    patric Guest

  3. #3

    Default Re: Mac Keycodes

    In article <1ec975dc.0308292231.41761043posting.google.com >, patric
    <patrick_cusackhotmail.com> wrote:
    > Yes, I accidentally swapped the 2F. No, my intent is to pass a key to
    > a POSTEVENT routine. However, The program that I am sending it to sees
    > it as the non-numeric "/", whereas I wish to send the "/" from the
    > numeric keyboard. Any suggestions? POSTEVENT requires an eventmsg - I
    > assume it means an ascii character? I only wish to somehow
    > differentiate between the two slashes.
    The message field of the event record contains both the character code
    (in the low byte) and the key code (in the next byte).
    James W. Walker Guest

  4. #4

    Default Re: Mac Keycodes

    In article <1ec975dc.0308292231.41761043posting.google.com >,
    [email]patrick_cusackhotmail.com[/email] (patric) wrote:
    >Yes, I accidentally swapped the 2F. No, my intent is to pass a key to
    >a POSTEVENT routine. However, The program that I am sending it to sees
    >it as the non-numeric "/", whereas I wish to send the "/" from the
    >numeric keyboard.
    They are different keys and therefore have different numbers.
    They'll also have different numbers on different keyboards.

    If you want to know what number a certain key generates, the
    simplest method is to write a program which tells you the
    number of each key pressed.


    Simon Slavin Guest

  5. #5

    Default Re: Mac Keycodes

    "James W. Walker" <osxNOSPAMjwwalker.com.invalid> wrote in message news:<300820030039226756%osxNOSPAMjwwalker.com.in valid>...
    > In article <1ec975dc.0308292231.41761043posting.google.com >, patric
    > <patrick_cusackhotmail.com> wrote:
    >
    > > Yes, I accidentally swapped the 2F. No, my intent is to pass a key to
    > > a POSTEVENT routine. However, The program that I am sending it to sees
    > > it as the non-numeric "/", whereas I wish to send the "/" from the
    > > numeric keyboard. Any suggestions? POSTEVENT requires an eventmsg - I
    > > assume it means an ascii character? I only wish to somehow
    > > differentiate between the two slashes.
    >
    > The message field of the event record contains both the character code
    > (in the low byte) and the key code (in the next byte).
    James,

    Thanks for your patience. That worked brilliantly. I looked at the
    apple IM series for the description of the event record. Yet, I
    noticed that it did not have any fields for any modifier keys. I guess
    I could use PPostevent for that, but as it is not supported in Carbon,
    I am reluctant to use it. Thanks.

    Patric
    patric Guest

  6. #6

    Default Re: Mac Keycodes

    In article <1ec975dc.0309012233.70082496posting.google.com >, patric
    <patrick_cusackhotmail.com> wrote:
    > Yet, I
    > noticed that it did not have any fields for any modifier keys. I guess
    > I could use PPostevent for that, but as it is not supported in Carbon,
    > I am reluctant to use it.
    Under OS 9, you could load the PPostEvent function pointer from
    InterfaceLib using CFM routines (I forget the exact ones). Under OS X,
    you can use CGPostKeyboardEvent instead.
    James W. Walker Guest

Similar Threads

  1. Problems with KeyCodes for multiple keys?
    By randycrews in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 24th, 07:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139