~ubuntu-branches/ubuntu/trusty/lmms/trusty

« back to all changes in this revision

Viewing changes to plugins/zynaddsubfx/fltk/src/Fl_get_key_mac.cxx

  • Committer: Charlie Smotherman
  • Date: 2012-12-05 22:08:38 UTC
  • mfrom: (33.1.7 lmms_0.4.13)
  • Revision ID: cjsmo@cableone.net-20121205220838-09pjfzew9m5023hr
* New  Upstream release.
  - Minor tweaking to ZynAddSubFX, CALF, SWH plugins  and Stefan Fendt's RC
    filters.
  - Added UI fixes: Magnentic effect of knobs and Piano-roll fixes
  - Updated German localization and copyright year
* debian/lmms-common.install:
  - added /usr/share/applications so the lmms.desktop file will correctly
    install (LP: #863366)
  - This should also fix the Software Center not displaying lmms in sound
    and video (LP: #824231)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
// "$Id: Fl_get_key_mac.cxx 7615 2010-05-26 21:25:11Z manolo $"
 
2
// "$Id: Fl_get_key_mac.cxx 8624 2011-04-26 17:28:10Z manolo $"
3
3
//
4
4
// MacOS keyboard state routines for the Fast Light Tool Kit (FLTK).
5
5
//
6
 
// Copyright 1998-2009 by Bill Spitzak and others.
 
6
// Copyright 1998-2010 by Bill Spitzak and others.
7
7
//
8
8
// This library is free software; you can redistribute it and/or
9
9
// modify it under the terms of the GNU Library General Public
34
34
#include <config.h>
35
35
 
36
36
// convert an FLTK (X) keysym to a MacOS symbol:
37
 
// See also the inverse converter in Fl_mac.cxx
38
 
// This table is in numeric order by FLTK symbol order for binary search:
 
37
// See also the inverse converter in table macKeyLookUp of Fl_cocoa.mm
 
38
// This table is in numeric order by FLTK symbol order for binary search.
 
39
// The list of Mac OS virtual keycodes appears with OS 10.5 in
 
40
// ...../Carbon.framework/Frameworks/HIToolbox.framework/Headers/Events.h
39
41
 
40
42
static const struct {unsigned short vk, fltk;} vktab[] = {
41
43
  { 49, ' ' }, { 39, '\'' }, { 43, ',' }, { 27, '-' }, { 47, '.' }, { 44, '/' }, 
49
51
  { 12, 'Q' }, { 15, 'R'  }, {  1, 'S'  }, { 17, 'T'  }, 
50
52
  { 32, 'U' }, {  9, 'V'  }, { 13, 'W'  }, {  7, 'X'  }, 
51
53
  { 16, 'Y' }, {  6, 'Z'  }, 
52
 
  { 33, '[' }, { 30, ']' }, { 50, '`' },  { 42, '|' },
53
 
  { 51, FL_BackSpace }, { 48, FL_Tab }, { 36, FL_Enter }, { 127, FL_Pause },
54
 
  { 107, FL_Scroll_Lock }, { 53, FL_Escape }, { 0x73, FL_Home }, { 123, FL_Left },
 
54
  { 33, '[' }, { 30, ']' }, { 50, '`' },  { 42, '\\' },
 
55
  { 51, FL_BackSpace }, { 48, FL_Tab }, { 36, FL_Enter }, { 0x7F, FL_Pause },
 
56
  { 0x7F, FL_Scroll_Lock }, { 53, FL_Escape }, { 0x73, FL_Home }, { 123, FL_Left },
55
57
  { 126, FL_Up }, { 124, FL_Right }, { 125, FL_Down }, { 0x74, FL_Page_Up },
56
 
  { 0x79, FL_Page_Down },  { 119, FL_End }, { 0x71, FL_Print }, { 127, FL_Insert },
57
 
  { 0x6e, FL_Menu }, { 114, FL_Help }, /*{ 0x47, FL_Num_Lock },*/
 
58
  { 0x79, FL_Page_Down },  { 119, FL_End }, { 0x7F, FL_Print }, { 0x7F, FL_Insert },
 
59
  { 0x6e, FL_Menu }, { 114, FL_Help }, { 0x47, FL_Num_Lock },
58
60
  { 76, FL_KP_Enter }, { 67, FL_KP+'*' }, { 69, FL_KP+'+'}, { 78, FL_KP+'-' }, { 65, FL_KP+'.' }, { 75, FL_KP+'/' }, 
59
61
  { 82, FL_KP+'0' }, { 83, FL_KP+'1' }, { 84, FL_KP+'2' }, { 85, FL_KP+'3' }, 
60
62
  { 86, FL_KP+'4' }, { 87, FL_KP+'5' }, { 88, FL_KP+'6' }, { 89, FL_KP+'7' }, 
62
64
  { 0x7a, FL_F+1 }, { 0x78, FL_F+2  }, { 0x63, FL_F+3  }, { 0x76, FL_F+4  }, 
63
65
  { 0x60, FL_F+5 }, { 0x61, FL_F+6  }, { 0x62, FL_F+7  }, { 0x64, FL_F+8  }, 
64
66
  { 0x65, FL_F+9 }, { 0x6D, FL_F+10 }, { 0x67, FL_F+11 }, { 0x6f, FL_F+12 }, 
65
 
  { 56, FL_Shift_L }, { 56, FL_Shift_R }, { 59, FL_Control_L }, { 59, FL_Control_R }, 
66
 
  { 57, FL_Caps_Lock }, { 55, FL_Meta_L }, { 55, FL_Meta_R },
67
 
  { 58, FL_Alt_L }, { 58, FL_Alt_R }, /*{ 0x75, FL_Delete },*/ { 0x47, FL_Delete },
 
67
  { 0x69, FL_F+13 }, { 0x6B, FL_F+14 }, { 0x71, FL_F+15 }, { 0x6A, FL_F+16 }, 
 
68
  { 0x38, FL_Shift_L }, { 0x3C, FL_Shift_R }, { 0x3B, FL_Control_L }, { 0x3E, FL_Control_R }, 
 
69
  { 0x39, FL_Caps_Lock }, { 0x37, FL_Meta_L }, { 0x36, FL_Meta_R },
 
70
  { 0x3A, FL_Alt_L }, { 0x3D, FL_Alt_R }, { 0x75, FL_Delete },
68
71
};
69
72
 
70
73
static int fltk2mac(int fltk) {
83
86
  return get_key(k);
84
87
}
85
88
 
86
 
#include <stdio.h>
87
 
 
88
89
//: returns true, if that key is pressed right now
89
90
int Fl::get_key(int k) {
90
91
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
94
95
  else 
95
96
#endif
96
97
  {
97
 
  KeyMap foo;
98
 
  GetKeys(foo);
 
98
  typedef UInt32 fl_KeyMap[4];
 
99
  fl_KeyMap foo;
 
100
  // use the GetKeys Carbon function
 
101
  typedef void (*keymap_f)(fl_KeyMap);
 
102
  static keymap_f f = NULL;
 
103
  if (!f) f = ( keymap_f )Fl_X::get_carbon_function("GetKeys");
 
104
  (*f)(foo);
99
105
#ifdef MAC_TEST_FOR_KEYCODES
100
106
 static int cnt = 0;
101
107
 if (cnt++>1024) {
114
120
}
115
121
 
116
122
//
117
 
// End of "$Id: Fl_get_key_mac.cxx 7615 2010-05-26 21:25:11Z manolo $".
 
123
// End of "$Id: Fl_get_key_mac.cxx 8624 2011-04-26 17:28:10Z manolo $".
118
124
//