Skip to content

Commit

Permalink
Prl Type v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JulyIghor committed Feb 22, 2021
1 parent 64ceb16 commit e3c3af3
Show file tree
Hide file tree
Showing 5 changed files with 698 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@
*.exe
*.out
*.app

/bin
/out
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,38 @@
# prltype
# Prl Type

This is command line tool for using with [Parallels Desktop](http://www.parallels.com/products/desktop/).

### Requirements

* [Parallels Virtualization SDK for Mac](https://www.parallels.com/download/pvsdk/), download and install it.

### Building from Source

```
make
```
All binaries are built into ```bin/``` folder

## Usage

#### prltype

A command to send text a keyboard events to a Virtual Machine.
```prltype <vm_name> <text or commands>```

Example:
```prltype Ubuntu 'Hello World' '<enter>'``` will type ```Hello World``` and press Enter to the virtual machine named Ubuntu.

List of acceptable commands:
Keyboard keys: <ALT>, <BACKSPACE>, <BS>, <CAPSLOCK>, <CTL>, <DEL>, <DELETE>, <DOWN>, <END>, <ENTER>, <ESC>, <F1>, <F10>, <F11>, <F12>, <F2>, <F3>, <F4>, <F5>, <F6>, <F7>, <F8>, <F9>, <HOME>, <INSERT>, <LALT>, <LCTRL>, <LEFT>, <LSHIFT>, <LWIN>, <NUMLOCK>, <PAUSE>, <PGDN>, <PGUP>, <POWER>, <PRTSCR>, <RALT>, <RCTRL>, <RIGHT>, <RSHIFT>, <RWIN>, <SCROLLLOCK>, <SHIFT>, <SLEEP>, <SPACE>, <TAB>, <UP>, <WAKE>, <WIN>, <LALT>, <LCTRL>, <LSHIFT>, <LWIN>
Special command: <WAIT> - delay of 1 second

## License

This code is distributed under the GPL v3 license, see LICENSE.

© 2021 July Ighor

---

Parallels Desktop is a registered trademark of Parallels Software International, Inc.
51 changes: 51 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// This file is part of Prl Type
// https://github.com/JulyIghor/prltype
// Copyright (C) 2020-2021 July Ighor <julyighor@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// In addition, as a special exception, the copyright holders give
// permission to link the code of portions of this program with the
// OpenSSL library under certain conditions as described in each
// individual source file, and distribute linked combinations including
// the two.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

#include "prltype.h"
#include <iostream>
#include <unordered_map>

int main(int argc, char* argv[])
{
if (argc < 2)
{
std::cout << "PrlType v1.0\thttps://github.com/JulyIghor/prltype\n\nUsage: " << argv[0] << " <VM Name> <text/command>" << std::endl;
return -1;
}

PrlType prl;

if (!prl.connect(argv[1]))
{
std::cout << "Can't connect to VM " << argv[1] << std::endl;
return -1;
}

for (int w = 2; w < argc; w++)
if (!prl.typeString(argv[w]))
{
std::cout << "Failed to type " << argv[w] << std::endl;
return 1;
}
return 0;
}
Loading

0 comments on commit e3c3af3

Please sign in to comment.