QCAD

QCAD - 2D CAD System.

Click here for a documentation of the DokuWiki formatting syntax that can be used in reports

Please search for existing tasks (also closed ones) before opening a new task.

Please make sure that you are using the latest Version of QCAD before posting a bug (menu Help - Check for Updates)

Tasklist

FS#393 - Scrolling with arrow keys

Attached to Project: QCAD
Opened by Andrew (andrew) - Monday, 14 November 2011, 15:47 GMT+2
Last edited by Andrew (andrew) - Friday, 18 November 2011, 17:52 GMT+2
Task Type Feature Request
Category Main
Status Closed
Assigned To Andrew (andrew)
Operating System All
Severity Low
Priority Normal
Reported Version 3 RC1
Due in Version 3.0.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Scrolling with arrow keys

This task depends upon

Closed by  Andrew (andrew)
Friday, 18 November 2011, 17:52 GMT+2
Reason for closing:  Implemented
Comment by Andrew (andrew) - Friday, 18 November 2011, 17:52 GMT+2

Implementation:

File scripts/Navigation/DefaultNavigation/DefaultNavigation.js

Add method:

DefaultNavigation.prototype.keyPressEvent = function(event) {
    var v = undefined;
 
    if (event.key()===Qt.Key_Left.valueOf()) {
        v = new RVector(50, 0);
    } else if (event.key()===Qt.Key_Right.valueOf()) {
        v = new RVector(-50, 0);
    } else if (event.key()===Qt.Key_Up.valueOf()) {
        v = new RVector(0, 50);
    } else if (event.key()===Qt.Key_Down.valueOf()) {
        v = new RVector(0, -50);
    }
 
    if (!isNull(v)) {
        this.view.pan(v);
        event.accept();
    }
};

Loading...