summary refs log tree commit diff stats
path: root/.travis.yml
Commit message (Expand)AuthorAgeFilesLines
* CI: Depend on Jester HEAD because of nim-lang/nimble#129.Dominik Picheta2016-09-251-1/+1
* Enable coroutines again.cheatfate2016-07-301-1/+3
* Disable fasm usagecheatfate2016-07-291-3/+1
* Add nimscript test and run it in Travis CIFederico Ceratto2016-04-031-0/+1
* tries to fix the travis buildAraq2015-10-261-0/+1
* try to make travis generate the tar.xzAraq2015-10-251-0/+2
* Fixed tests for TravisCIYuriy Glukhov2015-10-221-0/+2
* use tester directlyAman Gupta2015-10-131-1/+2
* really be pedanticAman Gupta2015-10-131-1/+1
* run all testsAman Gupta2015-10-061-1/+1
* fail CI when tests failAman Gupta2015-10-021-6/+4
* fix test failures due to import errorsAman Gupta2015-10-021-0/+2
* install nimble and zip packageAman Gupta2015-10-021-0/+3
* download fasm for the coro buildAman Gupta2015-10-021-0/+5
* use clang for threading tests on travisAman Gupta2015-10-021-0/+1
* add libcurl and libsdl1 headersAman Gupta2015-09-291-0/+5
* remove mac builds for nowAman Gupta2015-09-291-1/+0
* build on macosx tooAman Gupta2015-09-291-1/+3
* run in travisci containersAman Gupta2015-09-291-0/+1
* set PATH for testsAman Gupta2015-09-291-0/+1
* fix current directoryAman Gupta2015-09-291-1/+3
* no more build.sh, bootstrap release tooAman Gupta2015-09-291-2/+6
* add basic travis configAman Gupta2015-09-291-0/+6
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/>. import curses class MouseEvent(object): PRESSED = [ 0, curses.BUTTON1_PRESSED, curses.BUTTON2_PRESSED, curses.BUTTON3_PRESSED, curses.BUTTON4_PRESSED ] def __init__(self, getmouse): """Creates a MouseEvent object from the result of win.getmouse()""" _, self.x, self.y, _, self.bstate = getmouse # x-values above ~220 suddenly became negative, apparently # it's sufficient to add 0xFF to fix that error. if self.x < 0: self.x += 0xFF if self.y < 0: self.y += 0xFF def pressed(self, n): """Returns whether the mouse key n is pressed""" try: return (self.bstate & MouseEvent.PRESSED[n]) != 0 except: return False def mouse_wheel_direction(self): if self.bstate & curses.BUTTON4_PRESSED: return -1 elif self.bstate & curses.BUTTON2_PRESSED \ or self.bstate > curses.ALL_MOUSE_EVENTS: return 1 else: return 0 def ctrl(self): return self.bstate & curses.BUTTON_CTRL def alt(self): return self.bstate & curses.BUTTON_ALT def shift(self): return self.bstate & curses.BUTTON_SHIFT def key_invalid(self): return self.bstate > curses.ALL_MOUSE_EVENTS