خرید بک لینک

Vote count: 0

When I was making keyboard events with a local CGEventRef, I noticed that even though it was not a pointer, you could "edit" its properties with functions, like so:

CGEventRef eventRef = CGEventCreateKeyboardEvent(....);
CGEventSetFlags(eventRef, ...);
CGEventSetType(eventRef, kCGEventKeyDown);

Then you Postthe event. I know that if you do something like this;

Player p; //assume Player has an x property and a y property (both public)
p.x = 100000; p.y = -431;
void changePlayerPosition(Player player__, int x, int y){
   player__.x = x; player__.y = y;
}
changePlayerPostion(10, 43);
std::cout << p.x << p.y; //prints x=1000000 y=-431 even though we tried to edit the values to 10 and 43 in the function

The values do not change even though we edited them in the changePlayerPosition function. I know you can fix this by getting the address of player__ in the argument i.e Player &player__.

That was an example. I guess my real question is, how is CGEventRef eventRefproperties like its flag, type, etc.edited without passing in a pointer or address in functions such as CGEventSetFlags, CGEventSetType, etc. Thank you so much!

asked 55 secs ago

برچسب: is a local potential graded,is a local diploma bad,is a local ordinance a misdemeanor,is a local authority a public body,is a local authority a body corporate,is a local council a public authority,is a local council a corporation,is a local anesthetic painful,is a local authority search necessary, نویسنده: استخدام کار تاريخ: يکشنبه 21 شهريور 1395 ساعت: 20:55

صفحه بندی