shift

How to press “Ctrl+Shift+Q” in AutoIt

笑着哭i 提交于 2019-11-26 18:42:07
问题 I have an application which has a shortcut key Ctrl + Shift + Q to quit it. I want to press Ctrl + Shift + Q via AutoIt to exit my application. I tried it as below: Send("{LCTRL} {LSHIFT} Q") and ControlSend("{LCTRL} {LSHIFT} Q") But none of them did work. Please guide me to do it the right way. 回答1: You want something like: Send("{CTRLDOWN}{SHIFTDOWN}q{CTRLUP}{SHIFTUP}") What you are sending presses the keys individually in sequence, rather than chaining them together. Hope that helps!

c get nth byte of integer

心已入冬 提交于 2019-11-26 09:07:53
问题 I know you can get the first byte by using int x = number & ((1<<8)-1); or int x = number & 0xFF; But I don\'t know how to get the nth byte of an integer. For example, 1234 is 00000000 00000000 00000100 11010010 as 32bit integer How can I get all of those bytes? first one would be 210, second would be 4 and the last two would be 0. 回答1: int x = (number >> (8*n)) & 0xff; where n is 0 for the first byte, 1 for the second byte, etc. 回答2: For the (n+1)th byte in whatever order they appear in