Page 2 of 2

Re: API questions

Posted: Fri Sep 22, 2017 12:46 pm
by Santos
Neat, thanks! :)

Code: Select all

function love.load()
  imagedata = love.image.newImageData('image.png')
  width, height = imagedata:getDimensions()

  compressed = love.math.compress(imagedata, 'gzip')
  filedata = love.filesystem.newFileData(compressed:getString(), '')
  decompressed = love.math.decompress(filedata, 'gzip')

  imagedata = love.image.newImageData(width, height, decompressed)
  image = love.graphics.newImage(imagedata)
end

function love.draw()
  love.graphics.draw(image)
end

Re: API questions

Posted: Mon Sep 25, 2017 12:00 pm
by Santos
So this is probably an SDL thing and maybe a "my computer is just weird" thing, but when I press this laptop's Fn key and press the function keys, I get unexpected results from love.keypressed.

For example, when I press Fn and F1 (which is mute), I get the key "d" (the scancodes are the same as the keys for all of these). It doesn't output the letter "d" in other applications though. Volume down and up are "c" and "b", numlock and scrolllock are as expected, display switch is "lgui" and search is "f14".

So uh, is this normal?

Re: API questions

Posted: Mon Sep 25, 2017 1:26 pm
by slime
Weird. I've never heard of that before - but it's not something love's code can really affect, in any case. (It'd be up to either SDL or the operating system APIs that SDL calls).

Re: API questions

Posted: Mon Sep 25, 2017 2:02 pm
by Santos
Weird indeed, thanks slime.

Re: API questions

Posted: Mon Sep 25, 2017 5:54 pm
by Nixola
I have a similar bug on Linux, except it affects everything and the key is never released, meaning that it leads to stuff like ddddddddddddd typed all over what I'm doing.