Skip to content

Commit a2e2696

Browse files
committed
Now using specific key to stop the loop
1 parent e26d130 commit a2e2696

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ This program solve the problem in 2 different ways:
3535

3636
## Cool ! How do I use it ?
3737

38-
- Download the [**executable**](https://github.com/loitho/acmi-compiler/releases/download/v0.1/acmi-compiler-v0.1.exe)
38+
- Download the [**executable**](https://github.com/loitho/acmi-compiler/releases/download/v0.2/acmi-compiler-v0.2.exe)
3939

4040
- Move the .exe file to your ACMI folder (by default: C:\Falcon BMS 4.33 U1\User\Acmi)
4141

42+
- **Clear the ACMI Folder of any .flt file**
43+
4244
- Run the .exe by double clicking on it. (It must run in the background)
4345

4446
- Start Falcon BMS and play normally, the program will detect new .flt and prevent falcon from converting them

src/FolderMonitor.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// FolderMonitor.cpp
2-
// File created : 2017-10-22
2+
// File created : 2017-11-6
33
//
44
//
5-
// Last update : 2017-11-4
5+
// Last update : 2017-11-7
66
// By loitho
77

88
// https://msdn.microsoft.com/en-us/library/aa365261%28VS.85%29.aspx?f=255&MSPPError=-2147217396
@@ -88,7 +88,7 @@ int WatchDirectory(LPTSTR lpDir)
8888
}
8989

9090
printf("\nWaiting for change in folder...\n");
91-
printf("\nOnce you finished recording your flight on BMS\n press any key to stop the loop and prepare for conversion\n");
91+
printf("\nOnce you finished recording your flight on BMS\n press the 'k' key to stop the loop and prepare for conversion\n");
9292

9393
while (TRUE)
9494
{
@@ -124,10 +124,18 @@ int WatchDirectory(LPTSTR lpDir)
124124
// Check if we received a keyboard input
125125
if (_kbhit())
126126
{
127-
printf("\nKey struck was '%c'\n\n", _getch());
127+
char c = _getch();
128+
128129

129-
// Who need to check exit value when you can throw your way out
130-
throw std::runtime_error("keyboard input");
130+
if (c == 'k')
131+
{
132+
printf("\nLoop stopped\n\n");
133+
134+
// Who need to check exit value when you can throw your way out
135+
throw std::runtime_error("keyboard input");
136+
}
137+
138+
printf("\nKey struck was '%c', you need to press 'k' if you want to stop the loop and start compilation\n\n", c);
131139
}
132140

133141

0 commit comments

Comments
 (0)