Skip to content

SendIput with multiples INPUTs #235

Answered by ilopX
JillyTaboga asked this question in Q&A
Discussion options

You must be logged in to vote
// Copyright (c) 2020, Dart | Windows.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// Demonstrates sending input to another window via SendInput()

// ignore_for_file: constant_identifier_names

import 'dart:ffi';

import 'package:ffi/ffi.dart';
import 'package:win32/win32.dart';

const VK_SHIFT = 0x10;
const VK_D = 0x44;

void main() {
  runNotepad();

  sendKeyDown(VK_SHIFT);
  sendKeyDown(VK_D);
  sendKeyUp(VK_D);
  sendKeyUp(VK_SHIFT);

  sendUnicode("art is awesome €");
}

void runNotepad() {
  print('Switching to Notepad and going to sleep for a second.');
  Sh…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JillyTaboga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants