PianoKeyBoard | 自定义的钢琴键盘 从A0 - C8 一共88个键 支持多点触控和多点滑动 | Keyboard library

 by   ideastudios Java Version: 1.1.1 License: No License

kandi X-RAY | PianoKeyBoard Summary

kandi X-RAY | PianoKeyBoard Summary

PianoKeyBoard is a Java library typically used in Utilities, Keyboard applications. PianoKeyBoard has no bugs, it has no vulnerabilities, it has build file available and it has low support. You can download it from GitHub.

自定义的钢琴键盘 从A0 - C8 一共88个键 支持多点触控和多点滑动(如果与系统手势快捷方式冲突则不支持 比如miui (三指下拉截屏) 不支持三指及以上滑动) 支持键盘移动.

            kandi-support Support

              PianoKeyBoard has a low active ecosystem.
              It has 25 star(s) with 9 fork(s). There are 3 watchers for this library.
              It had no major release in the last 12 months.
              There are 3 open issues and 0 have been closed. On average issues are closed in 180 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of PianoKeyBoard is 1.1.1

            kandi-Quality Quality

              PianoKeyBoard has no bugs reported.

            kandi-Security Security

              PianoKeyBoard has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              PianoKeyBoard does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              PianoKeyBoard releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed PianoKeyBoard and discovered the below as its top functions. This is intended to give you an instant insight into PianoKeyBoard implemented functionality, and help decide if they suit your requirements.
            • Initializes this instance
            • Initialize SoundPlayUtils
            • Move to position
            • Show next button
            • Handles a new touch event
            • Fire a key up event
            • Process a finger
            • Process a new touch event
            • Set the white keyed drawable
            • Initializes the list of keys
            • Draws the keys on the canvas
            • Draws the key
            • Initializes the prekeyboard style
            • Re - invalidates the font and measures
            • Get Key by code
            • Gets the key code
            • Suspend the dimensions of the image
            • Measure the size
            • Set the black key drawable
            • Set the black key height ratio
            • Set the black keyed drawable
            • Set black key width
            • Set key count
            • Set the white key drawable
            • Reset the size of the map
            • Sets the pronunc text
            Get all kandi verified functions for this library.

            PianoKeyBoard Key Features

            No Key Features are available at this moment for PianoKeyBoard.

            PianoKeyBoard Examples and Code Snippets

            Javadot img1Lines of Code : 36dot img1no licencesLicense : No License
            copy iconCopy
                 * 设置是否播放音效
                public void setIsPlaySound(boolean isPlaySound) {
                 * 根据黑/白键的code 获取黑/白键 code从21-108 和midi键盘对应
                public Key getKeyByKeycode(int code) {
                 * 移动键盘到当前位置 即键盘显示的第一个白键为当前位置  
            Javadot img2Lines of Code : 29dot img2no licencesLicense : No License
            copy iconCopy
            Javadot img3Lines of Code : 27dot img3no licencesLicense : No License
            copy iconCopy
                  * 键盘的监听
                 public interface KeyListener {
                      * 键盘被按下的回调
                      * @param key 被按下的键
                     void onKeyPressed(Key key);
                      * 键盘被按松开的回调

            Community Discussions


            How to Implement Attachable Properties for ItemTemplate and ItemsSource
            Asked 2017-Nov-06 at 18:23

            I am trying to use the WPF Grid as an ItemsControl using attached properties for the purposes of creating a scalable Piano Keyboard. Each key in the keyboard may span 1 to three columns depending upon what precedes and succeeds it and will span 1 row if sharp or 2 if natural. I already have 2 attached properties for setting the Grid's Column Count and Row Count dynamically (albeit these will need to be adjusted to support the setting of each column/row's width/height).

            What I now need to implement are two attachable properties for the ItemsSource (Keys) and the ItemTemplate (PianoKeyView). I need to use this on the Grid control because ItemsControl only supports UniformGrid as a Grid for its ItemsPanel and also doesn't assignment of specific items to specific columns/rows. My Piano Keyboard would require 17 columns per octave of keys but an ItemsControl would only create 12 columns in a UniformGrid as there would only be 12 keys passed to it. I have included an image of a 1-octave Piano Keyboard with the index of each required column included.

            This is my code for the keyboard as it currently stands, I am missing the implementation for GridExtensions.ItemsSource and GridExtensions.ItemTemplate. GridExtensions is a static class containing attachable properties.



            Answered 2017-Nov-06 at 18:23

            What I was trying to achieve with the Grid directly could be achieved with an ItemsControl with an ItemsPanel of Grid.

            It turns out the missing piece that was needed was a Style with a TargetType of ContentPresenter. In this style, the attachable Grid properties such as Grid.RowSpan, Grid.Column and Grid.ColumnSpan are settable via the appropriate converters which take in the ItemsControl and Key's DataContext and return the required integer. The Z-Index of the keys is also settable here so that the sharp keys appear above the natural keys.

            Source https://stackoverflow.com/questions/47097540


            HTML element's value property is giving undefined value
            Asked 2017-Aug-13 at 19:57

            This is totally mysterious. I checked everything, googled everything, but looks like this should work. I've done same things in my code with others html elements and they all give me the values, but this time I'm getting undefined for this particular HTML element. The snippet of code below:



            Answered 2017-Aug-13 at 19:57

            That is because

            elements do not have a value attribute. It is only for a selected subset of elements: , , ,
          • , , , and .

            You can store the value as a HTML5 data- attribute, i.e.:

          • Source https://stackoverflow.com/questions/45664269


            Raising an event on a control in XAML
            Asked 2017-Apr-18 at 12:31

            I am trying to write a XAML control for a Piano Keyboard in WPF which responds to NoteOn and NoteOff MIDI events from an external MIDI keyboard. I am using Tom Lokovic's midi-dot-net to raise NoteOn and NoteOff events triggered by the hardware but I need a way to get these events to raise the NoteOn and NoteOff events of my XAML Key class (derived from the WPF Button). The colour of a key should change when it is on and the event should be subscribable to so that a user of the Piano Keyboard control can play a sound the key is pressed.

            I could do this by passing every Midi.InputDevice to every single key on the keyboard so that each one can subscribe to the NoteOn and NoteOff events of every InputDevice then, in turn raise their own NoteOn and NoteOff events but the problem with this is that the PianoKeyboard control (an ItemsControl which holds Keys) and its nested Key controls all become tightly coupled to the implementation of midi-dot-net. If I have to do this I will, but it seemed like there should be a better way of doing this in WPF moving the dependency on midi-dot-net higher up in the call stack.

            I have too much code to paste in its entirety here and still be readable so here's a sample of one of the DataTemplates I'm using as my PianoKeyboard's ItemTemplate.

            Essentially what I'm asking is: given an input device is not supported to trigger a WPF button with the button's built in behaviour (e.g. a mouse click), how does one get it to trigger the button without coupling it to a derived class of the button?



            Answered 2017-Apr-18 at 12:17

            You could raise the Click event programmatically:

            Source https://stackoverflow.com/questions/43471794

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install PianoKeyBoard

            You can download it from GitHub.
            You can use PianoKeyBoard like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the PianoKeyBoard component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone ideastudios/PianoKeyBoard

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Keyboard Libraries


            by ccampbell


            by symless


            by jaywcjlove


            by randyrants

            Try Top Libraries by ideastudios


            by ideastudiosJava


            by ideastudiosC


            by ideastudiosJava


            by ideastudiosC


            by ideastudiosC++