Skip to content

Solution for: Leonardo keyboard API only allows ASCII input #1391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Solution for: Leonardo keyboard API only allows ASCII input #1391

wants to merge 2 commits into from

Conversation

yahesh
Copy link

@yahesh yahesh commented Apr 28, 2013

Add pressKeycode(k, send) and releaseKeycode(k, send) methods to class Keyboard_ to fix issues with the QWERTY-only press(k) and release(k) methods. Additionally rewrite press(k) and release(k) to actually use the new Keycode(k, send) methods and add some KEYCODE_ defines.

This fixes the following issue: #1386

Kenneth Newwood added 2 commits April 28, 2013 15:22
…s Keyboard_ to fix issues with the QWERTY-only press(k) and release(k) methods. Additionally rewrite press(k) and release(k) to actually use the new *Keycode(k, send) methods and add some KEYCODE_* defines.
@obra
Copy link
Contributor

obra commented Jan 10, 2014

As I'm reviewing HID-related commits, I notice that you did a lot of rewriting of 0 to 0x00 and 1 to 0x01.

Is this anything other than just a personal preference?

@yahesh
Copy link
Author

yahesh commented Jan 10, 2014

This is just a personal preference.

@nospam2000
Copy link

On 10.01.2014, at 01:14, Jesse Vincent [email protected] wrote:

As I'm reviewing HID-related commits, I notice that you did a lot of rewriting of 0 to 0x00 and 1 to 0x01.

Is this anything other than just a personal preference?

Just a personal preference, I’m always using hex values for bitmasks and decimal values for bit numbers. For 0 and 1 this makes no big difference but for 0x1000 it is better readable.

Michael

@obra
Copy link
Contributor

obra commented Jan 10, 2014

nod Thanks, guys. One of the things I'm doing is splitting up the HID-related pull requests into one logical change per commit and extracting diffs that are just whitespace/cosmetic changes from the actual functional changes. That'll make it easier for the folks with commit privileges to review and explicitly accept or reject changes, rather than have them hang out as pull requests.

Thank you both for the work you've done on this stuff. I've been using it locally.

I'm hoping to have a branch with the work on pull request 1391 and pull request 1488 ready for review in the next week or so.

@matthijskooijman
Copy link
Collaborator

@obra, sounds like a great plan, thanks!

@rokison
Copy link

rokison commented Feb 11, 2014

Is there any word on when this might make it into an Arduino IDE release?
It is quite frustrating that the keyboard library is only compatible with a US keyboard layout, and I really want my backslash characters to be correctly typed!

@obra
Copy link
Contributor

obra commented Feb 11, 2014

On Tue, Feb 11, 2014 at 10:04:19AM -0800, rokison wrote:

Is there any word on when this might make it into an Arduino IDE release?
It is quite frustrating that the keyboard library is only compatible with a US keyboard layout, and I really want my backslash characters to be correctly typed!

I'm hard at work on it. Right now, it adds way too much overhead to arduino sketches that don't use the new functionality. I'd actually appreciate it if folks would test my code before it makes it into an IDE release. If you're up for building the IDE with these changes and trying them, that'd be double-plus amazing.

@rokison
Copy link

rokison commented Feb 11, 2014

I am quite a novice when it comes to building an IDE (in that I’ve never done it), but I’m more than willing to give it a try.
What would be amazing is if there were a Keyboard.region() function which could set which layout to use.
I’m aware there are a large number of regions, and this may not be feasible, but it seems that at least US and UK should be supported.
At the moment I’m forced to try and catch keys which cause issues, and manually enter ALT codes for them!
Let me know what I can do to help.
Best wishes
Oliver

From: Jesse Vincent [mailto:[email protected]]
Sent: 11 February 2014 18:21
To: arduino/Arduino
Cc: Rokison, Oliver
Subject: Re: [Arduino] Solution for: Leonardo keyboard API only allows ASCII input (#1391)

On Tue, Feb 11, 2014 at 10:04:19AM -0800, rokison wrote:

Is there any word on when this might make it into an Arduino IDE release?
It is quite frustrating that the keyboard library is only compatible with a US keyboard layout, and I really want my backslash characters to be correctly typed!

I'm hard at work on it. Right now, it adds way too much overhead to arduino sketches that don't use the new functionality. I'd actually appreciate it if folks would test my code before it makes it into an IDE release. If you're up for building the IDE with these changes and trying them, that'd be double-plus amazing.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1391#issuecomment-34786844.

St Paul's School is a charitable company limited by guarantee registered in England at
Lonsdale Road,
London SW13 9JT.
Registered Company Number 6141973. Registered Charity Number 1119619.

#####################################################################################
Scanned by MailMarshal - Marshal8e6's comprehensive email content security solution.
Download a free evaluation of MailMarshal at www.marshal.com
#####################################################################################

@obra
Copy link
Contributor

obra commented Feb 11, 2014

On Tue, Feb 11, 2014 at 10:27:47AM -0800, rokison wrote:

I am quite a novice when it comes to building an IDE (in that I’ve never done it), but I’m more than willing to give it a try.

Excellent.

The easiest thing to do is to git clone my fork with the branch for the new code.
I'm about to run for a flight, so these instructions are probably flawed, but,
from memory:

git clone https://github.com/obra/arduino
cd Arduino
git co usb-hid-enumerated
cd build
ant run

What would be amazing is if there were a Keyboard.region() function which could set which layout to use.

That might make a good Library on top of the core functionality. (Which would also let it iterate faster than the IDE)

Let me know what I can do to help.

@ffissore ffissore added New and removed 1.0 labels Feb 27, 2014
@cmaglie cmaglie added feature request A request to make an enhancement (not a bug fix) Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) Component: USB Device Opposed to USB Host. Related to the USB subsystem (SerialUSB, HID, ...) labels Apr 15, 2015
@facchinm
Copy link
Member

Close with #1803

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) Component: Core Related to the code for the standard Arduino API Component: USB Device Opposed to USB Host. Related to the USB subsystem (SerialUSB, HID, ...) feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants