Giter Club home page Giter Club logo

Comments (12)

darshankawar avatar darshankawar commented on June 8, 2024

@Senne021 Thanks for the report.

We're using Flutter for a webos application

Does it mean for LG Smart TV ? and you using the LG smart remote to navigate flutter app on it ? What's the specific keys are you pressing ?

We're getting the usbHidUsage: 0x01700000000 and the LogicalKeyboardKey unidentified

Can you provide us the entire log ?

from flutter.

Senne021 avatar Senne021 commented on June 8, 2024

@darshankawar Thank you for your reply.

Does it mean for LG Smart TV ? and you using the LG smart remote to navigate flutter app on it ? What's the specific keys are you pressing ?

Yes, we're using our app on LG Smart TVs. The missing key code occurs on both the real device and the simulator. Only the media and back buttons are affected by this issue.

Can you provide us the entire log ?

Here is the entire log of different key events:

Play and stop on the LG remote:

    KeyUpEvent(
        physicalKey: 
          PhysicalKeyboardKey(
              usbHidUsage: "0x1700000000",
              debugName: null
          ), 
        logicalKey: 
          LogicalKeyboardKey(
              keyId: "0x100000001", 
              keyLabel: "Unidentified", 
              debugName: null
          ), 
        character: null, 
        timeStamp: 0:01:03.819099
    )

And the key event of one of the arrow keys that work on an LG remote control:

    KeyDownEvent(
        physicalKey: PhysicalKeyboardKey(
            usbHidUsage: "0x00070051", 
            debugName: "Arrow Down"
        ), logicalKey: 
        LogicalKeyboardKey(
            keyId: "0x100000301", 
            keyLabel: "Arrow Down", 
            debugName: "Arrow Down"
        ), 
        character: null, 
        timeStamp: 0:00:14.981599
    )

from flutter.

darshankawar avatar darshankawar commented on June 8, 2024

Thanks for the update. Due to lack of said emulator / device, we can't currently verify this. Keeping the issue open for team's input / attention / tracking.

from flutter.

justinmc avatar justinmc commented on June 8, 2024

CC @gspencergoog I believe you wrote the feature mentioned in the description here.

from flutter.

gspencergoog avatar gspencergoog commented on June 8, 2024

Yes, but the RawKeyEvent implementation has been deprecated. The replacement KeyEvent implementation doesn't support access to the platform specific keycodes anymore, so that the entire key event system is more platform agnostic. Ideally, the fix for this is to create an appropriate mapping for the missing keys so that they are identifiable in the same way as other keys are, and the application doesn't need to check web keycodes at all.

from flutter.

Senne021 avatar Senne021 commented on June 8, 2024

@gspencergoog Thank you for your reply. How can I add this type of mapping to Flutter? Do you have an example of that?

from flutter.

gspencergoog avatar gspencergoog commented on June 8, 2024

Sorry, just to be more clear: the mapping isn't something you'd do normally when making an app, it's a base mapping in Flutter itself.

This is controlled by the keycode generator in https://github.com/flutter/flutter/tree/master/dev/tools/gen_keycodes and what would need to happen is an addition to the keycode database that has the correct mappings, whatever those are. You're welcome to try and build a PR for that yourself, otherwise someone on the Flutter team will need to do it.

from flutter.

yjbanov avatar yjbanov commented on June 8, 2024

@gspencergoog Do you think that expanding the mappings is a scalable solution? Would it make sense for us to provide hooks for extending the mappings in separate packages? For example, there could be a package:webos that adds WebOS-specific functionality.

from flutter.

gspencergoog avatar gspencergoog commented on June 8, 2024

It can already be done in a scalable way: you can define your own LogicalKeyboardKeys, and PhysicalKeyboardKeys in a package if you want. The mappings just generate the "standard" ones that come with Flutter to contribute to the common set for everyone to use.

However, in this case, the mapping seems to for a specific key called LogicalKeyboardKey.unidentified in the mappings, and I'm not quite sure what that's indicating. Perhaps there is something on the engine side that needs to be added? @dkwingsmt do you know?

from flutter.

yjbanov avatar yjbanov commented on June 8, 2024

I see, and wow, that's a big file! I wonder if we should break it up by platform and lazy-load only the mappings needed by the current platform. But that's a different story.

from flutter.

gspencergoog avatar gspencergoog commented on June 8, 2024

The mappings are converted into Dart code, so we don't load it or include it with the app or anything, it's strictly there for codegen purposes (and codegen only happens we we update the mapping and the results are checked in). The unused dart symbols are elided at compile time, so size isn't an issue there either.

from flutter.

Senne021 avatar Senne021 commented on June 8, 2024

@gspencergoog Thx for your input.
I've have looked a little bit deeper into the Flutter keycode generator you mentioned and found a problem when adding the webos keycode. The logical and physical keys for web applications are mapped according to the code and not the keycode (which doesn't seem to be used at all). When a key is pressed on a webos remote, an event is triggered where only the keyCode is set. The code value is empty and therefore can't be used for mapping.
Do we need web scan codes as some kind of fallback if the code value can't be found in the mapping?

from flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.