using System.Collections; using System.Collections.Generic; using UnityEngine; using System; using System.Runtime.InteropServices; using System.Threading; public class Macro2 : MonoBehaviour { private const int KEYEVENTF_KEYDOWN = 0x0000; private const int KEYEVENTF_KEYUP = 0x0002; [DllImport("user32.dll", CallingConvention = CallingConvention.StdCall)] static extern void keybd_event(int bVK, int bScan, int dwflags, int dwExtrainfo); public float men; // Start is called before the first frame update void Start() { Debug.Log("start"); } // Update is called once per frame void Update() { men = Input.GetAxisRaw("LB1"); if (men > 0) { keybd_event(0x61, 0, KEYEVENTF_KEYDOWN, 0); keybd_event(0x61, 0, KEYEVENTF_KEYUP, 0); } } }
これはLB1から(ゲームパッドの入力)入力があれば1を出力するというものですが、
メモ帳に対して有効ではないんですが、どうしてでしょうか?セッティング周りでしょうか・・?
あなたの回答
tips
プレビュー