0

I have found this: Programmatically Disable Mouse & keyboard

But if I copy the code to an new proj and try build it it says build failed. But there are no errors in the code it self.

Now my question is how i use event taps to do this (disable the keyboard)

Thanks for any suggestions. I'm new developing Mac OS X apps, so please forgive me if I ask something stupid.

Community
  • 1
  • 1
UNX
  • 79
  • 1
  • Did you add the carbon framework to your project and import it in your header file? – Adrian P May 15 '13 at 15:21
  • 1
    *But if I copy the code to an new proj and try build it it says build failed. But there are no errors in the code it self.* And that's what's wrong with this question. You can't copy and paste entire projects, then come running to us when it doesn't work complaining about build failures that dont exist. We need concrete data, and some effort on your part. What have you tried? What's the build error Xcode's throwing at you? – CodaFi May 15 '13 at 15:23
  • error " Undefined symbols for architecture x86_64: "_MyEventTapCallBack", referenced from: -[AppDelegate applicationDidFinishLaunching:] in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)" – UNX May 15 '13 at 16:27
  • Compare the project settings of the original with your new. – Wain May 15 '13 at 18:22

1 Answers1

1

This line gives your problem away (and you should have put this point in your original question):

Undefined symbols for architecture x86_64: "_MyEventTapCallBack

What this means is that wherever you defined MyEventTapCallBack isn't being linked into your application.

Check to make sure of case sensitivity (e.g. did you define it as "MyEventTapCallback" instead of "MyEventTapCallBack").

Also, if "MyEventTapCallBack" is defined in its own .m file, make sure the .m file is included as a member of the target. Check the file inspector on that .m file. Where you see the red circles, make certain your target is checked.

Make sure Target Membership is selected for your .m file

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • after i tried a little bit i had success. This post helped me: http://stackoverflow.com/questions/5785630/modify-nsevent-to-send-a-different-key-than-the-one-that-was-pressed/5785895#5785895 – UNX May 16 '13 at 14:24