This forum is in archive mode. You will not be able to post new content.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - noize

Pages: [1]
1
Scripting Languages / Re: [Lua] Char to ASCII code
« on: July 22, 2013, 10:13:01 PM »
Actually useful, ty.  Handy for WMs that use Lua scripting like ion.


I know about Ion but I've never used it. How would this be more useful in Ion than in any other window manager? Or maybe, you were just naming Ion as it has Lua preinstalled?

2
Scripting Languages / [Lua] Char to ASCII code
« on: July 21, 2013, 11:36:18 PM »
Just a simple script that shows you the ASCII code for any keystroke (single keys or keycombos (e.g: SHIFT + F2)).


Code: [Select]

--[[----------------------------------------------------------------------
' filename: c2a.wlua
' author: noize
------------------------------------------------------------------------]]


require("iuplua")


prompt = iup.text {
expand = "YES",
value = "Press one or more keys",
tip = "Key combos are accepted as well",
}


output = iup.text {
value = "together",
expand = "YES",
}


function prompt:k_any(key)
prompt.value = ""
output.value = key
end


dlg = iup.dialog {
iup.vbox {
iup.frame {
iup.hbox {
prompt,
},
title = "ASCII char",
},
iup.frame {
iup.hbox {
output
},
title = "ASCII code",
},
margin = "5x5",
gap = "5",
},
title = "Char to ASCII",
size = "EIGHTH",
background = "255 255 255",
}


dlg:show()


iup.SetFocus(prompt)


iup.MainLoop()




A quick one.

Pages: [1]


Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.