def keyPressEvent(self, e): if not self.cam: return if self.mouse_dwn: cam = dheng.wld_get_cam() key = e.key() if key == QtCore.Qt.Key_W or key == QtCore.Qt.Key_Up: dheng.cam_fwd(self.cam, 0.5) elif e.key() == QtCore.Qt.Key_S or key == QtCore.Qt.Key_Down: dheng.cam_fwd(self.cam, -0.5) elif e.key() == QtCore.Qt.Key_D or key == QtCore.Qt.Key_Right: dheng.cam_strafe(self.cam, 0.5) elif e.key() == QtCore.Qt.Key_A or key == QtCore.Qt.Key_Left: dheng.cam_strafe(self.cam, -0.5)
def wheelEvent(self, e): if not self.cam: return steps = e.delta() / 15 dheng.cam_fwd(self.cam, steps)
def wheelEvent(self, e): if not self.cam: return steps = e.delta()/15 dheng.cam_fwd(self.cam, steps)