DirectMyFile / console.dart

Console Library
Other
107 stars 24 forks source link

Can't exit without calling exit(0) after binding keyboard #8

Open Mixolyde opened 8 years ago

Mixolyde commented 8 years ago

I'd like to be able to close/end my application within unit tests without calling exit(0), because this exits from the unit test framework. But, if I don't call exit(0) the keyboard binding keeps the application alive forever. Ideally there would be a method to unbind all keys, and tell the Keyboard class to stop capturing input. Thanks.

azenla commented 8 years ago

Sure I can add this functionality in an hour or so :)

Mixolyde commented 8 years ago

I tried to do this with my own version, but it turns out to be a little trickier than I thought, because StreamSubscription objects are lost when a client uses the bindKey().listen method. I think the Keyboard class needs to capture those subscriptions so it can cancel them.

Mixolyde commented 7 years ago

Any update on this issue? I didn't see a fix in the latest update. Thanks.