C# is missing keyboard key

View: New views
14 Messages — Rating Filter:   Alert me  

C# is missing keyboard key

by Nikos Chantziaras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There seems to be a problem with the L key; it should play C#, but it
doesn't.

On a similar note, would it be too much work to extend the upper
keyboard mapping to include:

   TAB - B
   [   - F
   =   - F#
   ]   - G
   BACKSPACE - G#
   \   - A

That would be an *immense* help for people who need to use the keyboard,
or to *also* use the keyboard in addition to a MIDI keyboard :)


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: C# is missing keyboard key

by Andy Kelley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That is quite possibly my fault - I bound 'L' to "change global playback mode."

I didn't know we even supported using the keyboard as a midi input. The solution of course is a button toggling keyboard as a midi controller on or off.

Make sure this gets reported as a bug and I will fix it eventually.
 
On Mon, Oct 5, 2009 at 3:25 AM, Nikos Chantziaras <realnc@...> wrote:
There seems to be a problem with the L key; it should play C#, but it
doesn't.

On a similar note, would it be too much work to extend the upper
keyboard mapping to include:

  TAB - B
  [   - F
  =   - F#
  ]   - G
  BACKSPACE - G#
  \   - A

That would be an *immense* help for people who need to use the keyboard,
or to *also* use the keyboard in addition to a MIDI keyboard :)


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel



--
Andy Kelley
Nuclear Development
http://nucleardev.com/

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: C# is missing keyboard key

by Nikos Chantziaras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

(Andy, sorry if this reaches you twice, the list bounced my previous
attempt since I was posting through GMane before and forgot to subscribe
to also subscribe to the list normally.)

I will file a bug report about it.  I also noticed that TAB (keycode 23
on Linux) also can't be used.

I'm attaching a patch that adds:

    ` = A#
    TAB = B (but doesn't work, probably same reason L doesn't)
    [ = f'
    = = f'#
    ] = g'
    BACKSPACE = g'#
    \ = a''

If the patch is OK, it would be great if someone would push it.  The
patch is for Linux only; I don't know the scancodes of Windows and OS X :P


On 10/05/2009 01:47 PM, Andy Kelley wrote:

> That is quite possibly my fault - I bound 'L' to "change global playback
> mode."
>
> I didn't know we even supported using the keyboard as a midi input. The
> solution of course is a button toggling keyboard as a midi controller on
> or off.
>
> Make sure this gets reported as a bug and I will fix it eventually.
>
> On Mon, Oct 5, 2009 at 3:25 AM, Nikos Chantziaras <realnc@...
> <mailto:realnc@...>> wrote:
>
>     There seems to be a problem with the L key; it should play C#, but it
>     doesn't.
>
>     On a similar note, would it be too much work to extend the upper
>     keyboard mapping to include:
>
>        TAB - B
>        [   - F
>        =   - F#
>        ]   - G
>        BACKSPACE - G#
>        \   - A
>
>     That would be an *immense* help for people who need to use the keyboard,
>     or to *also* use the keyboard in addition to a MIDI keyboard :)

diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp
index 0b781a1..1f3d707 100644
--- a/src/gui/PianoView.cpp
+++ b/src/gui/PianoView.cpp
@@ -238,6 +238,8 @@ int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke )
  case 60: return 14; // . = d
  case 47: return 15; // ; = d#
  case 61: return 16; // / = e
+ case 49: return 10; // ` = A#
+ case 23: return 11; // TAB = B
  case 24: return 12; // Q = c
  case 11: return 13; // 2 = c#
  case 25: return 14; // W = d
@@ -255,6 +257,11 @@ int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke )
  case 32: return 26; // O = d'
  case 19: return 27; // 0 = d'#
  case 33: return 28; // P = e'
+ case 34: return 29; // [ = f'
+ case 21: return 30; // = = f'#
+ case 35: return 31; // ] = g'
+ case 22: return 32; // BACKSPACE = g'#
+ case 51: return 33; // \ = a''
  }
 #endif
 #ifdef LMMS_BUILD_APPLE


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: C# is missing keyboard key

by Bugzilla from eagles051387@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

would this be easier to change for instance to bind the keys of a keyboard a b c d and so on to the same keys on the keyboard and then use the plus or minus to make it into a sharp or a flat?

On Mon, Oct 5, 2009 at 1:32 PM, Nikos Chantziaras <realnc@...> wrote:
(Andy, sorry if this reaches you twice, the list bounced my previous attempt since I was posting through GMane before and forgot to subscribe to also subscribe to the list normally.)

I will file a bug report about it.  I also noticed that TAB (keycode 23 on Linux) also can't be used.

I'm attaching a patch that adds:

  ` = A#
  TAB = B (but doesn't work, probably same reason L doesn't)
  [ = f'
  = = f'#
  ] = g'
  BACKSPACE = g'#
  \ = a''

If the patch is OK, it would be great if someone would push it.  The patch is for Linux only; I don't know the scancodes of Windows and OS X :P



On 10/05/2009 01:47 PM, Andy Kelley wrote:
That is quite possibly my fault - I bound 'L' to "change global playback
mode."

I didn't know we even supported using the keyboard as a midi input. The
solution of course is a button toggling keyboard as a midi controller on
or off.

Make sure this gets reported as a bug and I will fix it eventually.

On Mon, Oct 5, 2009 at 3:25 AM, Nikos Chantziaras <realnc@...
<mailto:realnc@...>> wrote:

   There seems to be a problem with the L key; it should play C#, but it
   doesn't.

   On a similar note, would it be too much work to extend the upper
   keyboard mapping to include:

      TAB - B
      [   - F
      =   - F#
      ]   - G
      BACKSPACE - G#
      \   - A

   That would be an *immense* help for people who need to use the keyboard,
   or to *also* use the keyboard in addition to a MIDI keyboard :)

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel




--
Jonathan Aquilina

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: C# is missing keyboard key

by Nikos Chantziaras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That wouldn't work.  If you try to play something and need to switch to
flats in the midst of it... Just awkward :P

On 10/05/2009 03:01 PM, Jonathan Aquilina wrote:

> would this be easier to change for instance to bind the keys of a
> keyboard a b c d and so on to the same keys on the keyboard and then use
> the plus or minus to make it into a sharp or a flat?
>
> On Mon, Oct 5, 2009 at 1:32 PM, Nikos Chantziaras <realnc@...
> <mailto:realnc@...>> wrote:
>
>     (Andy, sorry if this reaches you twice, the list bounced my previous
>     attempt since I was posting through GMane before and forgot to
>     subscribe to also subscribe to the list normally.)
>
>     I will file a bug report about it.  I also noticed that TAB (keycode
>     23 on Linux) also can't be used.
>
>     I'm attaching a patch that adds:
>
>        ` = A#
>        TAB = B (but doesn't work, probably same reason L doesn't)
>        [ = f'
>        = = f'#
>        ] = g'
>        BACKSPACE = g'#
>        \ = a''
>
>     If the patch is OK, it would be great if someone would push it.  The
>     patch is for Linux only; I don't know the scancodes of Windows and
>     OS X :P
>
>
>
>     On 10/05/2009 01:47 PM, Andy Kelley wrote:
>
>         That is quite possibly my fault - I bound 'L' to "change global
>         playback
>         mode."
>
>         I didn't know we even supported using the keyboard as a midi
>         input. The
>         solution of course is a button toggling keyboard as a midi
>         controller on
>         or off.
>
>         Make sure this gets reported as a bug and I will fix it eventually.
>
>         On Mon, Oct 5, 2009 at 3:25 AM, Nikos Chantziaras
>         <realnc@... <mailto:realnc@...>
>         <mailto:realnc@... <mailto:realnc@...>>> wrote:
>
>             There seems to be a problem with the L key; it should play
>         C#, but it
>             doesn't.
>
>             On a similar note, would it be too much work to extend the upper
>             keyboard mapping to include:
>
>                TAB - B
>                [   - F
>                =   - F#
>                ]   - G
>                BACKSPACE - G#
>                \   - A
>
>             That would be an *immense* help for people who need to use
>         the keyboard,
>             or to *also* use the keyboard in addition to a MIDI keyboard :)

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: C# is missing keyboard key

by Bugzilla from eagles051387@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

what about in that case if you press the corresponding multiple times it changes to sharps and or flats with each press as need be

ex

press f repeatedly goes to sharp flat natural no sign double sharp or flat

On Mon, Oct 5, 2009 at 2:15 PM, Nikos Chantziaras <realnc@...> wrote:
That wouldn't work.  If you try to play something and need to switch to flats in the midst of it... Just awkward :P


On 10/05/2009 03:01 PM, Jonathan Aquilina wrote:
would this be easier to change for instance to bind the keys of a
keyboard a b c d and so on to the same keys on the keyboard and then use
the plus or minus to make it into a sharp or a flat?

On Mon, Oct 5, 2009 at 1:32 PM, Nikos Chantziaras <realnc@...
<mailto:realnc@...>> wrote:

   (Andy, sorry if this reaches you twice, the list bounced my previous
   attempt since I was posting through GMane before and forgot to
   subscribe to also subscribe to the list normally.)

   I will file a bug report about it.  I also noticed that TAB (keycode
   23 on Linux) also can't be used.

   I'm attaching a patch that adds:

      ` = A#
      TAB = B (but doesn't work, probably same reason L doesn't)
      [ = f'
      = = f'#
      ] = g'
      BACKSPACE = g'#
      \ = a''

   If the patch is OK, it would be great if someone would push it.  The
   patch is for Linux only; I don't know the scancodes of Windows and
   OS X :P



   On 10/05/2009 01:47 PM, Andy Kelley wrote:

       That is quite possibly my fault - I bound 'L' to "change global
       playback
       mode."

       I didn't know we even supported using the keyboard as a midi
       input. The
       solution of course is a button toggling keyboard as a midi
       controller on
       or off.

       Make sure this gets reported as a bug and I will fix it eventually.

       On Mon, Oct 5, 2009 at 3:25 AM, Nikos Chantziaras
       <realnc@... <mailto:realnc@...>
       <mailto:realnc@... <mailto:realnc@...>>> wrote:

           There seems to be a problem with the L key; it should play
       C#, but it
           doesn't.

           On a similar note, would it be too much work to extend the upper
           keyboard mapping to include:

              TAB - B
              [   - F
              =   - F#
              ]   - G
              BACKSPACE - G#
              \   - A

           That would be an *immense* help for people who need to use
       the keyboard,
           or to *also* use the keyboard in addition to a MIDI keyboard :)



--
Jonathan Aquilina

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: C# is missing keyboard key

by Nikos Chantziaras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That doesn't make sense to me.  Try playing a melody that way, it just
won't work.  Imagine removing all the black keys from your MIDI keyboard
and having to press a white one repeatedly to switch to flats.  Now try
playing something on such a keyboard :P


On 10/05/2009 03:22 PM, Jonathan Aquilina wrote:

> what about in that case if you press the corresponding multiple times it
> changes to sharps and or flats with each press as need be
>
> ex
>
> press f repeatedly goes to sharp flat natural no sign double sharp or flat
>
> On Mon, Oct 5, 2009 at 2:15 PM, Nikos Chantziaras <realnc@...
> <mailto:realnc@...>> wrote:
>
>     That wouldn't work.  If you try to play something and need to switch
>     to flats in the midst of it... Just awkward :P
>
>
>     On 10/05/2009 03:01 PM, Jonathan Aquilina wrote:
>
>         would this be easier to change for instance to bind the keys of a
>         keyboard a b c d and so on to the same keys on the keyboard and
>         then use
>         the plus or minus to make it into a sharp or a flat?
>
>         On Mon, Oct 5, 2009 at 1:32 PM, Nikos Chantziaras
>         <realnc@... <mailto:realnc@...>
>         <mailto:realnc@... <mailto:realnc@...>>> wrote:
>
>             (Andy, sorry if this reaches you twice, the list bounced my
>         previous
>             attempt since I was posting through GMane before and forgot to
>             subscribe to also subscribe to the list normally.)
>
>             I will file a bug report about it.  I also noticed that TAB
>         (keycode
>             23 on Linux) also can't be used.
>
>             I'm attaching a patch that adds:
>
>                ` = A#
>                TAB = B (but doesn't work, probably same reason L doesn't)
>                [ = f'
>                = = f'#
>                ] = g'
>                BACKSPACE = g'#
>                \ = a''
>
>             If the patch is OK, it would be great if someone would push
>         it.  The
>             patch is for Linux only; I don't know the scancodes of
>         Windows and
>             OS X :P
>
>
>
>             On 10/05/2009 01:47 PM, Andy Kelley wrote:
>
>                 That is quite possibly my fault - I bound 'L' to "change
>         global
>                 playback
>                 mode."
>
>                 I didn't know we even supported using the keyboard as a midi
>                 input. The
>                 solution of course is a button toggling keyboard as a midi
>                 controller on
>                 or off.
>
>                 Make sure this gets reported as a bug and I will fix it
>         eventually.
>
>                 On Mon, Oct 5, 2009 at 3:25 AM, Nikos Chantziaras
>         <realnc@... <mailto:realnc@...>
>         <mailto:realnc@... <mailto:realnc@...>>
>         <mailto:realnc@... <mailto:realnc@...>
>         <mailto:realnc@... <mailto:realnc@...>>>> wrote:
>
>                     There seems to be a problem with the L key; it
>         should play
>                 C#, but it
>                     doesn't.
>
>                     On a similar note, would it be too much work to
>         extend the upper
>                     keyboard mapping to include:
>
>                        TAB - B
>                        [   - F
>                        =   - F#
>                        ]   - G
>                        BACKSPACE - G#
>                        \   - A
>
>                     That would be an *immense* help for people who need
>         to use
>                 the keyboard,
>                     or to *also* use the keyboard in addition to a MIDI
>         keyboard :)

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: C# is missing keyboard key

by Nikos Chantziaras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 10/05/2009 02:32 PM, Nikos Chantziaras wrote:
> I will file a bug report about it. I also noticed that TAB (keycode 23
> on Linux) also can't be used.

I filed the bug report.  Also, I made TAB work by overriding
QWidget::event().  However, can someone help me a bit with a GCC error I
get?  This:

   bool PianoView::event( QEvent * event )
   {
        if (event->type() == QEvent::KeyPress) {
                QKeyEvent *ke = static_cast<QKeyEvent *>(event);
                if (ke->key() == Qt::Key_Tab) {
                        keyPressEvent(ke);
                        return true;
                }
        }
        return QWidget::event(event);
   }

Results in GCC barking:

   error: expected unqualified-id before numeric constant

If I replace:

   if (event->type() == QEvent::KeyPress) {

with:

   if (event->type() == 6) {

(QEvent::KeyPress's value is 6) then it compiles and works as intended.
  But of course using 6 isn't nice.

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: C# is missing keyboard key

by Bugzilla from apriori@dkc-clan.de :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all.

Well actually I can't recommend such an implementation and I second Nikos'
reasons here. The problem with LMMS' keyboard in general is, dependent on on
the current codec in use (at least, this is my assumption - I got a qwertz
layout) not all available keys are used. ZynAddSubfx on the other hand does
handle this in a much better way making it possible to play a bit higher
melodies. In the end, there is no way a pc keyboard would replace a real one
like you all do know. E.g. the completely random (at least it seems so) limit
of simultaneous key presses of 5 different keys depending on the location is
making the pc keyboard hardly useful.

Best regards

apriori

> That doesn't make sense to me.  Try playing a melody that way, it just
> won't work.  Imagine removing all the black keys from your MIDI keyboard
> and having to press a white one repeatedly to switch to flats.  Now try
> playing something on such a keyboard :P
>
> On 10/05/2009 03:22 PM, Jonathan Aquilina wrote:
> > what about in that case if you press the corresponding multiple times it
> > changes to sharps and or flats with each press as need be
> >
> > ex
> >
> > press f repeatedly goes to sharp flat natural no sign double sharp or
> > flat
> >
> > On Mon, Oct 5, 2009 at 2:15 PM, Nikos Chantziaras <realnc@...
> > <mailto:realnc@...>> wrote:
> >
> >     That wouldn't work.  If you try to play something and need to switch
> >     to flats in the midst of it... Just awkward :P
> >
> >
> >     On 10/05/2009 03:01 PM, Jonathan Aquilina wrote:
> >
> >         would this be easier to change for instance to bind the keys of a
> >         keyboard a b c d and so on to the same keys on the keyboard and
> >         then use
> >         the plus or minus to make it into a sharp or a flat?
> >
> >         On Mon, Oct 5, 2009 at 1:32 PM, Nikos Chantziaras
> >         <realnc@... <mailto:realnc@...>
> >         <mailto:realnc@... <mailto:realnc@...>>> wrote:
> >
> >             (Andy, sorry if this reaches you twice, the list bounced my
> >         previous
> >             attempt since I was posting through GMane before and forgot
> > to subscribe to also subscribe to the list normally.)
> >
> >             I will file a bug report about it.  I also noticed that TAB
> >         (keycode
> >             23 on Linux) also can't be used.
> >
> >             I'm attaching a patch that adds:
> >
> >                ` = A#
> >                TAB = B (but doesn't work, probably same reason L doesn't)
> >                [ = f'
> >                = = f'#
> >                ] = g'
> >                BACKSPACE = g'#
> >                \ = a''
> >
> >             If the patch is OK, it would be great if someone would push
> >         it.  The
> >             patch is for Linux only; I don't know the scancodes of
> >         Windows and
> >             OS X :P
> >
> >
> >
> >             On 10/05/2009 01:47 PM, Andy Kelley wrote:
> >
> >                 That is quite possibly my fault - I bound 'L' to "change
> >         global
> >                 playback
> >                 mode."
> >
> >                 I didn't know we even supported using the keyboard as a
> > midi input. The
> >                 solution of course is a button toggling keyboard as a
> > midi controller on
> >                 or off.
> >
> >                 Make sure this gets reported as a bug and I will fix it
> >         eventually.
> >
> >                 On Mon, Oct 5, 2009 at 3:25 AM, Nikos Chantziaras
> >         <realnc@... <mailto:realnc@...>
> >         <mailto:realnc@... <mailto:realnc@...>>
> >         <mailto:realnc@... <mailto:realnc@...>
> >         <mailto:realnc@... <mailto:realnc@...>>>> wrote:
> >
> >                     There seems to be a problem with the L key; it
> >         should play
> >                 C#, but it
> >                     doesn't.
> >
> >                     On a similar note, would it be too much work to
> >         extend the upper
> >                     keyboard mapping to include:
> >
> >                        TAB - B
> >                        [   - F
> >                        =   - F#
> >                        ]   - G
> >                        BACKSPACE - G#
> >                        \   - A
> >
> >                     That would be an *immense* help for people who need
> >         to use
> >                 the keyboard,
> >                     or to *also* use the keyboard in addition to a MIDI
> >         keyboard :)
>
> ---------------------------------------------------------------------------
> --- Come build with us! The BlackBerry® Developer Conference in SF, CA
>  is the only developer event you need to attend this year. Jumpstart your
>  developing skills, take BlackBerry mobile applications to market and stay
>  ahead of the curve. Join us from November 9-12, 2009. Register
>  now! http://p.sf.net/sfu/devconf
> _______________________________________________
> LMMS-devel mailing list
> LMMS-devel@...
> https://lists.sourceforge.net/lists/listinfo/lmms-devel
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

[Patch for review] Extend keyboard MIDI keys

by Nikos Chantziaras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I wrapped up my patch that enables additional keyboard keys to be used
for playing notes.  Please consider it for inclusion in LMMS.

Recognize additional keyboard scancodes for playing notes in a PianoView

The following additional keys are now recognized by PianoView:

   Left Shift = 'B
   Right Shift = f
   Enter = f#
   ` = A#
   TAB = B
   [ = f'
   = = f'#
   ] = g'
   BACKSPACE = g'#
   \ = a''

To handle TAB, we override QWidget::event().

On branch master
Changes to be committed:

        modified:   include/PianoView.h
        modified:   src/gui/PianoView.cpp

diff --git a/include/PianoView.h b/include/PianoView.h
index 4acc12d..d4149a3 100644
--- a/include/PianoView.h
+++ b/include/PianoView.h
@@ -45,6 +45,7 @@ public:

 protected:
  virtual void modelChanged();
+ virtual bool event( QEvent * event );
  virtual void keyPressEvent( QKeyEvent * ke );
  virtual void keyReleaseEvent( QKeyEvent * ke );
  virtual void contextMenuEvent( QContextMenuEvent * _me );
diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp
index 0b781a1..a05b09f 100644
--- a/src/gui/PianoView.cpp
+++ b/src/gui/PianoView.cpp
@@ -221,6 +221,7 @@ int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke )
 #ifdef LMMS_BUILD_LINUX
  switch( k )
  {
+ case 50: return -1; // Left Shift = 'B
  case 52: return 0; // Z  = C
  case 39: return 1; // S  = C#
  case 53: return 2; // X  = D
@@ -238,6 +239,10 @@ int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke )
  case 60: return 14; // . = d
  case 47: return 15; // ; = d#
  case 61: return 16; // / = e
+ case 62: return 17; // Right Shift = f
+ case 36: return 18; // Enter = f#
+ case 49: return 10; // ` = A#
+ case 23: return 11; // TAB = B
  case 24: return 12; // Q = c
  case 11: return 13; // 2 = c#
  case 25: return 14; // W = d
@@ -255,6 +260,11 @@ int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke )
  case 32: return 26; // O = d'
  case 19: return 27; // 0 = d'#
  case 33: return 28; // P = e'
+ case 34: return 29; // [ = f'
+ case 21: return 30; // = = f'#
+ case 35: return 31; // ] = g'
+ case 22: return 32; // BACKSPACE = g'#
+ case 51: return 33; // \ = a''
  }
 #endif
 #ifdef LMMS_BUILD_APPLE
@@ -320,6 +330,38 @@ void PianoView::modelChanged()



+/*! \brief Our own version of the main event handler.
+ *
+ *  We use our own handler to intercept events that wouldn't propagate
+ *  to us otherwise (like a TAB keypress, for example.)
+ *
+ *  \param event The event.
+ */
+// This #undef is needed; some X.Org header seems to define a KeyPress
+// macro, resulting in a compilation error.  Since this is not a header
+// file, it's safe to undef it.
+#ifdef KeyPress
+#undef KeyPress
+#endif
+bool PianoView::event( QEvent * event )
+{
+ if (event->type() == QEvent::KeyPress) {
+ QKeyEvent *ke = static_cast<QKeyEvent *>(event);
+ // On virtually all keyboards, TAB is always in the same
+ // position, so we save us the trouble of extracting its
+ // scancode (23) here.
+ if (ke->key() == Qt::Key_Tab) {
+ keyPressEvent(ke);
+ return true;
+ }
+ }
+ // Use the default handler for everything else.
+ return QWidget::event(event);
+}
+
+
+
+
 // gets the key from the given mouse-position
 /*! \brief Get the key from the mouse position in the piano display
  *

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: C# is missing keyboard key

by Nikos Chantziaras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 10/05/2009 04:19 PM, apriori@... wrote:
> Hi all.
>
> Well actually I can't recommend such an implementation and I second Nikos'
> reasons here. The problem with LMMS' keyboard in general is, dependent on on
> the current codec in use (at least, this is my assumption - I got a qwertz
> layout) not all available keys are used.

LMMS uses the key's scancode as reported by the hardware (at least on
Linux), so keyboard layout shouldn't actually matter.  Even on QWERTZ,
"Z" should play the same note as "Y" on QWERTY keyboards.  I think :P

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: [Patch for review] Extend keyboard MIDI keys

by Paul Giblock-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Personally, I'd prefer the . / ; ' [ ] - = \ ` and 1 keys be reserved
for context-aware shortcuts in the future

On Mon, Oct 5, 2009 at 12:33 PM, Nikos Chantziaras <realnc@...> wrote:

> I wrapped up my patch that enables additional keyboard keys to be used for
> playing notes.  Please consider it for inclusion in LMMS.
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> LMMS-devel mailing list
> LMMS-devel@...
> https://lists.sourceforge.net/lists/listinfo/lmms-devel
>
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: C# is missing keyboard key

by Paul Giblock-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Please read my previous post. I agree 'L' needs to be given back to
the C#.  However, please do not extend the range to the - = \ ` [ ] ;
'. / keys.

At leat - not right now,  maybe once we start using QAction
consistently and support uber-awesome configurable keyboard shortcuts.

-Paul

On Mon, Oct 5, 2009 at 12:43 PM, Nikos Chantziaras <realnc@...> wrote:

> On 10/05/2009 04:19 PM, apriori@... wrote:
>> Hi all.
>>
>> Well actually I can't recommend such an implementation and I second Nikos'
>> reasons here. The problem with LMMS' keyboard in general is, dependent on on
>> the current codec in use (at least, this is my assumption - I got a qwertz
>> layout) not all available keys are used.
>
> LMMS uses the key's scancode as reported by the hardware (at least on
> Linux), so keyboard layout shouldn't actually matter.  Even on QWERTZ,
> "Z" should play the same note as "Y" on QWERTY keyboards.  I think :P
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> LMMS-devel mailing list
> LMMS-devel@...
> https://lists.sourceforge.net/lists/listinfo/lmms-devel
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Re: [Patch for review] Extend keyboard MIDI keys

by Nikos Chantziaras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Since this is local to PianoView, the keys shouldn't interfere with
shortcuts, unless it has keyboard focus.

Anyway, I guess instead of "uber-awesome configurable shortcuts", the
most straight-forward way to get rid of all PianoView keys is to make
PianoView itself a toggle (a small on/off switch inside widgets that
embed a PianoView).  If the PianoView is disabled, none of the keys have
any special meaning anymore.  So with such a toggle, one could quicky
and easily bring a PianoView on screen when needed and then disable it
again.

On 10/05/2009 09:57 PM, Paul Giblock wrote:
> Personally, I'd prefer the . / ; ' [ ] - = \ ` and 1 keys be reserved
> for context-aware shortcuts in the future
>
> On Mon, Oct 5, 2009 at 12:33 PM, Nikos Chantziaras<realnc@...>  wrote:
>> I wrapped up my patch that enables additional keyboard keys to be used for
>> playing notes.  Please consider it for inclusion in LMMS.

--

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
LMMS-devel mailing list
LMMS-devel@...
https://lists.sourceforge.net/lists/listinfo/lmms-devel