Joren Van Onder e1a99b5027 [FIX] hw_drivers: read modifier keys in the event loop
Key input is handled in an evdev event loop. Before this commit the
state of modifier keys like shift, caps lock, ... were read when the
event was being processed. This doesn't always work because the evdev
events are processed asynchronously, i.e. when key A is being processed
in Python key B may have already been pressed.

Some devices that type fast, notably the Magtek card reader, this leads
to modifiers being applied to the wrong characters. Here's an example
before the patch:

5895000020000006^TEST/VAnTIV^251200000000000000?;4895000020000006=251200
000000000/\0600\0dD15ac71B75BA468E51F4e657529ADF6E3BDAC0A86A59B7adA12029
22F64BB55E74880A1908AD08AFC9372ADe21FD1E74D409C912C1A5|5C3D07B727DE46DaF
B6D8ED2007DB219F49FAC1311F0fa01474FC5BC621F33F915BE77D8DAF5E69A||6140300
0|076C0B3B0704CD78D7CF7Dc5B2ED3F0Ca3ad2e6c88d1F2310B7DB96973b4D556c2f9e4
016C60a7DB581990567FE5656E02C27276FA43BFE|B2ECCDE070215AA|336a4f78bb3c4C
\901209b2eCde000f3\4fC\100

This is what it looks like after the patch:

%B4895000020000006^TEST/VANTIV^251200000000000000?;4895000020000006=2512
00000000000?|0600|FE511F7BA7C38A4FA85D0135E58DDC798E557819356DADA132ECBE
D95184CCC77D7E2B1AE7E8AB076488B9757CA2A046C70590D01FA86217|5DAFE6EC44372
A3EF0358D42D08D9246DD8D2837150954B758199207697EFEB08A71B38B2E1690CE||614
03000|584CB8EBE3B17D2828C3B010DFB4E63E9F5036705CF7E547707DC75A9408E958DC
A3052B03031EA0F3B1F1163E40EF3F542B70F9FFD7912D|B2ECCDE070215AA|21352532D
D6E7334|90CDE0001FA|06A6||1000

These are some of the issues visible in the above example:
- there's a 5 instead of a % (on QWERTY SHIFT-5 is %)
- the n in VAnTIV is lowercase
- there's many /'s which should be ? (on QWERTY SHIFT-/ is ?)
- there's many \'s which should be | (once again on QWERTY SHIFT-\ is |)

To solve the issue, we read the state of the modifiers in the same event
loop.

opw-2122553

closes odoo/odoo#42767

X-original-commit: caa4c7ef6d23f695827b58e60a013a9438eb67cf
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-01-06 13:54:07 +00:00
…
2019-10-03 12:48:09 +00:00
…
…
…
2019-11-08 11:24:04 +00:00
2019-10-03 12:48:09 +00:00
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%