Carbon Event Manager (Carbon.CarbonEvt module) - working?

Discussion in 'Python' started by msmucr, May 15, 2012.

  1. msmucr

    msmucr Guest

    Hello,

    i would like to ask you for some information regarding Carbon Event
    Manager ( Carbon.CarbonEvt ) library in Python.
    I need to recieve and work with few Carbon events in my program. I've
    followed some examples on PyObjC site, but wasn't successful. I know,
    that both Carbon library and this Python module is deprecated, but
    frankly i didn't find any usable alternative except of writing of
    something from scratch..
    I ended on basic import of required objects from Carbon.CarbonEvt
    module -
    like "from Carbon.CarbonEvt import RegisterEventHotKey"
    I tried it in Python 2.7.1 (standard distribution in OS X 10.7 Lion)
    and Python 2.6.1 (standard Apple distribution in OS X 10.6).
    Do I have something wrong or is it simply broken and unmaintained now?

    Thank You,

    Michal
    msmucr, May 15, 2012
    #1
    1. Advertising

  2. msmucr

    John Gordon Guest

    In <> msmucr <> writes:

    > Do I have something wrong or is it simply broken and unmaintained now?


    We have no idea if you did anything wrong, because you didn't tell us
    exactly what you did and exactly what error message you received.

    --
    John Gordon A is for Amy, who fell down the stairs
    B is for Basil, assaulted by bears
    -- Edward Gorey, "The Gashlycrumb Tinies"
    John Gordon, May 15, 2012
    #2
    1. Advertising

  3. msmucr

    Kevin Walzer Guest

    On 5/15/12 3:06 PM, msmucr wrote:
    > Do I have something wrong or is it simply broken and unmaintained now?


    Support for Carbon Events was removed in Python 3.x and it does not work
    in 64-bit, to my knowledge--most of the Carbon API's are not supported
    by Apple anymore.

    --
    Kevin Walzer
    Code by Kevin
    http://www.codebykevin.com
    Kevin Walzer, May 15, 2012
    #3
  4. msmucr

    msmucr Guest

    On 15 kvÄ›, 21:21, John Gordon <> wrote:
    > In <> msmucr <> writes:
    >
    > > Do I have something wrong or is it simply broken and unmaintained now?

    >
    > We have no idea if you did anything wrong, because you didn't tell us
    > exactly what you did and exactly what error message you received.
    >
    > --
    > John Gordon                   A is for Amy, who fell down the stairs
    >              B is forBasil, assaulted by bears
    >                                 -- Edward Gorey, "The Gashlycrumb Tinies"


    Hello,

    i'm sorry for my very vague specification. I had problems with
    importing of anything from Carbon.CarbonEvt module and i wasn't sure
    what is wrong and was little bit stucked.
    I tried several desperate things before that as i've never worked with
    this module and it is my first thing with Carbon library.. Just before
    i read Kevin's reply i've figured, problem was, that OS X shipped
    Python wrapper /usr/bin/python runs by default 64bit version on recent
    Macs. So bindings for 32bit Carbon lib didn't work.
    Here is my output (i've choose RegisterEventHotKey as example):

    macmini-E514:~ macek$ /usr/bin/python -c "import sys; print
    sys.maxint; from Carbon.CarbonEvt import RegisterEventHotKey;
    print(RegisterEventHotKey.__doc__)"
    9223372036854775807
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    ImportError: cannot import name RegisterEventHotKey

    macmini-E514:~ macek$ env VERSIONER_PYTHON_PREFER_32_BIT=yes /usr/bin/
    python -c "import sys; print sys.maxint; from Carbon.CarbonEvt import
    RegisterEventHotKey; print(RegisterEventHotKey.__doc__)"
    2147483647
    (UInt32 inHotKeyCode, UInt32 inHotKeyModifiers, EventHotKeyID
    inHotKeyID, EventTargetRef inTarget, OptionBits inOptions) ->
    (EventHotKeyRef outRef)

    So, now i could start playing with it.. :)

    I'm trying to do something like this in Python
    http://www.macosxguru.net/article.php?story=20060204132802111

    Best regards and thank you for replies

    Michal
    msmucr, May 15, 2012
    #4
    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. Replies:
    1
    Views:
    332
    fortepianissimo
    Jan 21, 2005
  2. donbro
    Replies:
    2
    Views:
    526
    donbro
    Nov 1, 2005
  3. Abhilash
    Replies:
    0
    Views:
    264
    Abhilash
    Feb 7, 2007
  4. Abhilash
    Replies:
    0
    Views:
    275
    Abhilash
    Feb 7, 2007
  5. kitty
    Replies:
    3
    Views:
    484
    Joe Kesselman
    Jan 7, 2007
Loading...

Share This Page