Skip to content

Commit

Permalink
Renable key-repeat. Use ctrl-modifier for plotter on Windows/Linux. F…
Browse files Browse the repository at this point in the history
…ix modifier flags bug.
  • Loading branch information
stevenlovegrove committed Jul 9, 2014
1 parent 6b6a9fb commit 6d8f95f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/display.cpp
Expand Up @@ -482,8 +482,8 @@ void Mouse( int button_raw, int state, int x, int y)

last_x = (float)x;
last_y = (float)y;
const MouseButton button = (MouseButton)(1 << button_raw);

const MouseButton button = (MouseButton)(1 << (button_raw&0x7) );
const bool pressed = (state == 0);

context->had_input = context->is_double_buffered ? 2 : 1;
Expand Down
3 changes: 2 additions & 1 deletion src/display_glut.cpp
Expand Up @@ -106,7 +106,8 @@ void CreateGlutWindowAndBind(std::string window_title, int w, int h, unsigned in
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS);
#endif

glutIgnoreKeyRepeat(true);
// TODO: Need to implement our own key-repeat mechanism
//glutIgnoreKeyRepeat(true);

context->is_double_buffered = (mode & GLUT_DOUBLE) != 0;
TakeGlutCallbacks();
Expand Down
4 changes: 4 additions & 0 deletions src/plotter.cpp
Expand Up @@ -968,7 +968,11 @@ void Plotter::Special(View&, InputSpecial inType, float x, float y, float p1, fl
float scalex = 1.0;
float scaley = 1.0;

#ifdef _OSX_
if(button_state & KeyModifierCmd) {
#else
if (button_state & KeyModifierCtrl) {
#endif
scalex = 1-p1;
}else{
scaley = 1-p1;
Expand Down

0 comments on commit 6d8f95f

Please sign in to comment.