質問編集履歴
2
かひつだよ
test
CHANGED
File without changes
|
test
CHANGED
@@ -268,6 +268,8 @@
|
|
268
268
|
|
269
269
|
|
270
270
|
|
271
|
+
|
272
|
+
|
271
273
|
質問2
|
272
274
|
|
273
275
|
keybd_eventでは実際の出力でメモ帳にアタッチできなかったのはなぜなのか教えてください。
|
@@ -424,6 +426,8 @@
|
|
424
426
|
|
425
427
|
ゲムパの入力を取って1を出力するだけなのですが・・・
|
426
428
|
|
429
|
+
解説よりはコードをパチッと張ってもらったほうが嬉しいです。
|
430
|
+
|
427
431
|
|
428
432
|
|
429
433
|
|
1
加筆やっぱり
test
CHANGED
File without changes
|
test
CHANGED
@@ -276,6 +276,156 @@
|
|
276
276
|
|
277
277
|
メモ帳にfocusを当てると作動しませんでした。
|
278
278
|
|
279
|
+
やはり納得いかないので再質問させていただきます。
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
```ここに言語を入力
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
using System.Collections;
|
288
|
+
|
289
|
+
using System.Collections.Generic;
|
290
|
+
|
291
|
+
using UnityEngine;
|
292
|
+
|
293
|
+
using System;
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
using System.Runtime.InteropServices;
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
using System.Threading;
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
public class Macro2 : MonoBehaviour
|
306
|
+
|
307
|
+
{
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
private const int KEYEVENTF_KEYDOWN = 0x0000;
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
private const int KEYEVENTF_KEYUP = 0x0002;
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
[DllImport("user32.dll", CallingConvention = CallingConvention.StdCall)]
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
static extern void keybd_event(int bVK, int bScan, int dwflags, int dwExtrainfo);
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
public float men;
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
// Start is called before the first frame update
|
346
|
+
|
347
|
+
void Start()
|
348
|
+
|
349
|
+
{
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
Debug.Log("start");
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
}
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
// Update is called once per frame
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
void Update()
|
372
|
+
|
373
|
+
{
|
374
|
+
|
375
|
+
men = Input.GetAxisRaw("LB1");
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
if (men > 0)
|
380
|
+
|
381
|
+
{
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
keybd_event(0x61, 0, KEYEVENTF_KEYDOWN, 0);
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
keybd_event(0x61, 0, KEYEVENTF_KEYUP, 0);
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
}
|
414
|
+
|
415
|
+
}
|
416
|
+
|
417
|
+
}
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
```
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
ゲムパの入力を取って1を出力するだけなのですが・・・
|
426
|
+
|
427
|
+
|
428
|
+
|
279
429
|
|
280
430
|
|
281
431
|
何故なんでしょう・・・?
|