Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6356803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:02:22+00:00 2026-05-24T23:02:22+00:00

So, I asked another question here: How to tell the difference between a user-tapped

  • 0

So, I asked another question here:

How to tell the difference between a user-tapped keyboard event and a generated one?

One of the answers that came up was to use the “mouse pressure” field (unlikely to be used for a keyboard event) to mark the event as needed.

So, I’m trying:

CGEventSetIntegerValueField(myKeyboardEvent,
kCGMouseEventPressure,
0xFEEDFACE);

The problem is:

  1. I don’t know what 0xFEEDFACE means. What does that value default to? What should I set it to? How can I check whether it has been marked by me?
  2. Running the above code gives me an error:

<Error>: kCGErrorIllegalArgument: CGEventSetIntegerValueField: invalid event

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:02:24+00:00Added an answer on May 24, 2026 at 11:02 pm

    0xFEEDFACE is just a dummy value. It’s one of a number of 4-byte numbers with silly hex spellings that will stand out when you’re looking at memory.

    The function takes three arguments: an event, a CGEventField (which is an enum), and an int64_t (8-byte signed integer) whose range of valid values probably depends on the field. I used 0xFEEDFACE to indicate that you could try putting an arbitrary “magic” value in there,* and then check for it when you received the event, using CGEventGetIntegerValueField. If your event tap receives a new event that has your “magic number”, then it was (almost certainly) sent by you. Otherwise, it was sent by the system.

    To sum up and answer your explicit questions: that argument doesn’t default to anything; you should pass something arbitrary that is unlikely to be used by the events system (you might want to inspect a series of events sent by the system to see what “real” values look like); the idea is that your arbitrary value allows you to check that the event was marked by you.

    As for the error, it looks like I was wrong. I thought that you might be able to set any field on any kind of event (e.g., using the “mouse pressure” field on a keyboard event, since the system almost certainly won’t have set that) to pass along arbitrary information (and so identify the events that you’ve constructed yourself). It seems, however, that Event Services won’t let you do that. There may be other fields that you can use, but I don’t know for sure.


    *I assumed you would understand that it was a junk value; sorry.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I earlier asked another question here However, I later realized that my requirements are
This is a question I asked on another forum which received some decent answers,
I asked one question here but I didn't get exactly what I wanted. So,
Alright. So I asked a question here but I feared that I anwsered it
I just asked another question here: global variable and reduce database accesses in PHP+MySQL
This question is in relation to another question asked here: Sorting 1M records I
OK, so this is leading on from another question I asked here recently. Basically,
Here is a link to another question I asked concerning the same project I
As a result of another question I asked here I want to use a
I'm raising this question because of another question I asked here on SO some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.